Skip to content

Commit

Permalink
scsi: mpt3sas: Use cached ATA Information VPD page
Browse files Browse the repository at this point in the history
We now cache VPD page 0x89 (ATA Information) so there is no need to request
it from the hardware. Make mpt3sas use the cached page.

Link: https://lore.kernel.org/r/[email protected]
Cc: Sreekanth Reddy <[email protected]>
Reviewed-by: Hannes Reinecke <[email protected]>
Reviewed-by: Johannes Thumshirn <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
  • Loading branch information
martinkpetersen committed May 2, 2022
1 parent 646db1a commit dc11787
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions drivers/scsi/mpt3sas/mpt3sas_scsih.c
Original file line number Diff line number Diff line change
Expand Up @@ -12588,20 +12588,18 @@ scsih_pci_mmio_enabled(struct pci_dev *pdev)
*/
bool scsih_ncq_prio_supp(struct scsi_device *sdev)
{
unsigned char *buf;
struct scsi_vpd *vpd;
bool ncq_prio_supp = false;

if (!scsi_device_supports_vpd(sdev))
return ncq_prio_supp;

buf = kmalloc(SCSI_VPD_PG_LEN, GFP_KERNEL);
if (!buf)
return ncq_prio_supp;
rcu_read_lock();
vpd = rcu_dereference(sdev->vpd_pg89);
if (!vpd || vpd->len < 214)
goto out;

if (!scsi_get_vpd_page(sdev, 0x89, buf, SCSI_VPD_PG_LEN))
ncq_prio_supp = (buf[213] >> 4) & 1;
ncq_prio_supp = (vpd->data[213] >> 4) & 1;
out:
rcu_read_unlock();

kfree(buf);
return ncq_prio_supp;
}
/*
Expand Down

0 comments on commit dc11787

Please sign in to comment.