Thread (37 messages) 37 messages, 6 authors, 2016-03-10

Re: [PATCH v6 19/20] cxlflash: Use new cxl_pci_read_adapter_vpd() API

From: Matthew R. Ochs <hidden>
Date: 2016-03-04 16:32:27
Also in: linux-scsi

This patch should have also been sent to the SCSI list (included now).

Changes look fine.

Acked-by: Matthew R. Ochs <redacted>
On Mar 4, 2016, at 5:26 AM, Frederic Barrat =
[off-list ref] wrote:
quoted hunk ↗ jump to hunk
=20
To read the adapter VPD, drivers can't rely on pci config APIs, as it
wouldn't work on powerVM. cxl introduced a new kernel API especially
for this, so start using it.
=20
Co-authored-by: Christophe Lombard [off-list ref]
Signed-off-by: Frederic Barrat <redacted>
Signed-off-by: Christophe Lombard <redacted>
---
drivers/scsi/cxlflash/common.h |  1 -
drivers/scsi/cxlflash/main.c   | 18 ++----------------
2 files changed, 2 insertions(+), 17 deletions(-)
=20
diff --git a/drivers/scsi/cxlflash/common.h =
b/drivers/scsi/cxlflash/common.h
quoted hunk ↗ jump to hunk
index 5ada926..580f370 100644
--- a/drivers/scsi/cxlflash/common.h
+++ b/drivers/scsi/cxlflash/common.h
@@ -106,7 +106,6 @@ struct cxlflash_cfg {
	atomic_t scan_host_needed;
=20
	struct cxl_afu *cxl_afu;
-	struct pci_dev *parent_dev;
=20
	atomic_t recovery_threads;
	struct mutex ctx_recovery_mutex;
diff --git a/drivers/scsi/cxlflash/main.c =
b/drivers/scsi/cxlflash/main.c
quoted hunk ↗ jump to hunk
index f6d90ce..e04aae7 100644
--- a/drivers/scsi/cxlflash/main.c
+++ b/drivers/scsi/cxlflash/main.c
@@ -1407,7 +1407,7 @@ static int start_context(struct cxlflash_cfg =
*cfg)
quoted hunk ↗ jump to hunk
 */
static int read_vpd(struct cxlflash_cfg *cfg, u64 wwpn[])
{
-	struct pci_dev *dev =3D cfg->parent_dev;
+	struct pci_dev *dev =3D cfg->dev;
	int rc =3D 0;
	int ro_start, ro_size, i, j, k;
	ssize_t vpd_size;
@@ -1416,7 +1416,7 @@ static int read_vpd(struct cxlflash_cfg *cfg, =
u64 wwpn[])
	char *wwpn_vpd_tags[NUM_FC_PORTS] =3D { "V5", "V6" };
=20
	/* Get the VPD data from the device */
-	vpd_size =3D pci_read_vpd(dev, 0, sizeof(vpd_data), vpd_data);
+	vpd_size =3D cxl_read_adapter_vpd(dev, vpd_data, =
sizeof(vpd_data));
	if (unlikely(vpd_size <=3D 0)) {
		dev_err(&dev->dev, "%s: Unable to read VPD (size =3D =
%ld)\n",
quoted hunk ↗ jump to hunk
		       __func__, vpd_size);
@@ -2392,7 +2392,6 @@ static int cxlflash_probe(struct pci_dev *pdev,
{
	struct Scsi_Host *host;
	struct cxlflash_cfg *cfg =3D NULL;
-	struct device *phys_dev;
	struct dev_dependent_vals *ddv;
	int rc =3D 0;
=20
@@ -2458,19 +2457,6 @@ static int cxlflash_probe(struct pci_dev *pdev,
=20
	pci_set_drvdata(pdev, cfg);
=20
-	/*
-	 * Use the special service provided to look up the physical
-	 * PCI device, since we are called on the probe of the virtual
-	 * PCI host bus (vphb)
-	 */
-	phys_dev =3D cxl_get_phys_dev(pdev);
-	if (!dev_is_pci(phys_dev)) {
-		dev_err(&pdev->dev, "%s: not a pci dev\n", __func__);
-		rc =3D -ENODEV;
-		goto out_remove;
-	}
-	cfg->parent_dev =3D to_pci_dev(phys_dev);
-
	cfg->cxl_afu =3D cxl_pci_to_afu(pdev);
=20
	rc =3D init_pci(cfg);
--=20
1.9.1
=20
_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help