From: Manoj Kumar <manoj@linux.vnet.ibm.com>
To: Frederic Barrat <fbarrat@linux.vnet.ibm.com>,
imunsie@au1.ibm.com, michael.neuling@au1.ibm.com,
mrochs@linux.vnet.ibm.com, linuxppc-dev@lists.ozlabs.org,
linux-scsi@vger.kernel.org
Subject: Re: [PATCH v6 19/20] cxlflash: Use new cxl_pci_read_adapter_vpd() API
Date: Fri, 4 Mar 2016 11:41:38 -0600 [thread overview]
Message-ID: <56D9C8D2.1010201@linux.vnet.ibm.com> (raw)
In-Reply-To: <1457090804-9719-20-git-send-email-fbarrat@linux.vnet.ibm.com>
Fred:
Thanks for submitting this. Including linux-scsi.
Acked-by: Manoj N. Kumar <manoj@linux.vnet.ibm.com>
- Manoj
On 3/4/2016 5:26 AM, Frederic Barrat wrote:
> 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.
>
> Co-authored-by: Christophe Lombard <clombard@linux.vnet.ibm.com>
> Signed-off-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com>
> Signed-off-by: Christophe Lombard <clombard@linux.vnet.ibm.com>
> ---
> drivers/scsi/cxlflash/common.h | 1 -
> drivers/scsi/cxlflash/main.c | 18 ++----------------
> 2 files changed, 2 insertions(+), 17 deletions(-)
>
> diff --git a/drivers/scsi/cxlflash/common.h b/drivers/scsi/cxlflash/common.h
> 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;
>
> struct cxl_afu *cxl_afu;
> - struct pci_dev *parent_dev;
>
> atomic_t recovery_threads;
> struct mutex ctx_recovery_mutex;
> diff --git a/drivers/scsi/cxlflash/main.c b/drivers/scsi/cxlflash/main.c
> 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)
> */
> static int read_vpd(struct cxlflash_cfg *cfg, u64 wwpn[])
> {
> - struct pci_dev *dev = cfg->parent_dev;
> + struct pci_dev *dev = cfg->dev;
> int rc = 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] = { "V5", "V6" };
>
> /* Get the VPD data from the device */
> - vpd_size = pci_read_vpd(dev, 0, sizeof(vpd_data), vpd_data);
> + vpd_size = cxl_read_adapter_vpd(dev, vpd_data, sizeof(vpd_data));
> if (unlikely(vpd_size <= 0)) {
> dev_err(&dev->dev, "%s: Unable to read VPD (size = %ld)\n",
> __func__, vpd_size);
> @@ -2392,7 +2392,6 @@ static int cxlflash_probe(struct pci_dev *pdev,
> {
> struct Scsi_Host *host;
> struct cxlflash_cfg *cfg = NULL;
> - struct device *phys_dev;
> struct dev_dependent_vals *ddv;
> int rc = 0;
>
> @@ -2458,19 +2457,6 @@ static int cxlflash_probe(struct pci_dev *pdev,
>
> pci_set_drvdata(pdev, cfg);
>
> - /*
> - * 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 = cxl_get_phys_dev(pdev);
> - if (!dev_is_pci(phys_dev)) {
> - dev_err(&pdev->dev, "%s: not a pci dev\n", __func__);
> - rc = -ENODEV;
> - goto out_remove;
> - }
> - cfg->parent_dev = to_pci_dev(phys_dev);
> -
> cfg->cxl_afu = cxl_pci_to_afu(pdev);
>
> rc = init_pci(cfg);
>
prev parent reply other threads:[~2016-03-04 17:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1457090804-9719-1-git-send-email-fbarrat@linux.vnet.ibm.com>
[not found] ` <1457090804-9719-20-git-send-email-fbarrat@linux.vnet.ibm.com>
2016-03-04 16:32 ` [PATCH v6 19/20] cxlflash: Use new cxl_pci_read_adapter_vpd() API Matthew R. Ochs
2016-03-04 17:41 ` Manoj Kumar [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56D9C8D2.1010201@linux.vnet.ibm.com \
--to=manoj@linux.vnet.ibm.com \
--cc=fbarrat@linux.vnet.ibm.com \
--cc=imunsie@au1.ibm.com \
--cc=linux-scsi@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=michael.neuling@au1.ibm.com \
--cc=mrochs@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).