提交 dc117876 编写于 作者: M Martin K. Petersen

scsi: mpt3sas: Use cached ATA Information VPD page

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/20220302053559.32147-2-martin.petersen@oracle.com
Cc: Sreekanth Reddy <sreekanth.reddy@broadcom.com>
Reviewed-by: NHannes Reinecke <hare@suse.de>
Reviewed-by: NJohannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: NChristoph Hellwig <hch@lst.de>
Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
上级 646db1a5
...@@ -12588,20 +12588,18 @@ scsih_pci_mmio_enabled(struct pci_dev *pdev) ...@@ -12588,20 +12588,18 @@ scsih_pci_mmio_enabled(struct pci_dev *pdev)
*/ */
bool scsih_ncq_prio_supp(struct scsi_device *sdev) bool scsih_ncq_prio_supp(struct scsi_device *sdev)
{ {
unsigned char *buf; struct scsi_vpd *vpd;
bool ncq_prio_supp = false; bool ncq_prio_supp = false;
if (!scsi_device_supports_vpd(sdev)) rcu_read_lock();
return ncq_prio_supp; vpd = rcu_dereference(sdev->vpd_pg89);
if (!vpd || vpd->len < 214)
buf = kmalloc(SCSI_VPD_PG_LEN, GFP_KERNEL); goto out;
if (!buf)
return ncq_prio_supp;
if (!scsi_get_vpd_page(sdev, 0x89, buf, SCSI_VPD_PG_LEN)) ncq_prio_supp = (vpd->data[213] >> 4) & 1;
ncq_prio_supp = (buf[213] >> 4) & 1; out:
rcu_read_unlock();
kfree(buf);
return ncq_prio_supp; return ncq_prio_supp;
} }
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册