All of lore.kernel.org
 help / color / mirror / Atom feed
From: Frederic Barrat <fbarrat@linux.vnet.ibm.com>
To: linuxppc-dev@lists.ozlabs.org, Michael Ellerman <mpe@ellerman.id.au>
Subject: Re: [PATCH] cxl: Add cxl_read_adapter_vpd() to the kernel API
Date: Fri, 4 Mar 2016 12:22:59 +0100	[thread overview]
Message-ID: <56D97013.2010703@linux.vnet.ibm.com> (raw)
In-Reply-To: <1453223694-5190-1-git-send-email-fbarrat@linux.vnet.ibm.com>


The point of this patch was to break a dependency with cxlflash, so that 
they could drop their powerVM changes independently from cxl.

Since this hasn't hit upstream or next yet, change of plan: we've agreed 
with cxlflash that the cxl powerVM patchset will do the (small) 
modification to cxlflash (and remove the now obsolete cxl_get_phys_dev() 
kernel API, as discussed in this thread with Mikey). So no more 
dependencies.
It will be part of the powerVM patchset v6

   Fred


Le 19/01/2016 18:14, Frederic Barrat a écrit :
> Introduce a new API to read the VPD of the adapter. In bare-metal, a
> kernel driver can find out the adapter pci_dev behind the AFU device
> and call pci_read_vpd() directly, but it won't work in a (powerVM)
> guest.
> Current implementation is a stub to allow existing drivers (cxlflash)
> to start using it.
>
> Signed-off-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com>
> ---
>   drivers/misc/cxl/api.c | 8 ++++++++
>   include/misc/cxl.h     | 5 +++++
>   2 files changed, 13 insertions(+)
>
> diff --git a/drivers/misc/cxl/api.c b/drivers/misc/cxl/api.c
> index ea3eeb7..c73aa3a 100644
> --- a/drivers/misc/cxl/api.c
> +++ b/drivers/misc/cxl/api.c
> @@ -363,3 +363,11 @@ void cxl_perst_reloads_same_image(struct cxl_afu *afu,
>   	afu->adapter->perst_same_image = perst_reloads_same_image;
>   }
>   EXPORT_SYMBOL_GPL(cxl_perst_reloads_same_image);
> +
> +ssize_t cxl_read_adapter_vpd(struct pci_dev *afu_dev, void *buf, size_t count)
> +{
> +	struct device *parent = cxl_get_phys_dev(afu_dev);
> +
> +	return pci_read_vpd(to_pci_dev(parent), 0, count, buf);
> +}
> +EXPORT_SYMBOL_GPL(cxl_read_adapter_vpd);
> diff --git a/include/misc/cxl.h b/include/misc/cxl.h
> index f2ffe5b..3f9e84f 100644
> --- a/include/misc/cxl.h
> +++ b/include/misc/cxl.h
> @@ -210,4 +210,9 @@ ssize_t cxl_fd_read(struct file *file, char __user *buf, size_t count,
>   void cxl_perst_reloads_same_image(struct cxl_afu *afu,
>   				  bool perst_reloads_same_image);
>
> +/*
> + * Read the VPD of the adapter where the AFU pci dev resides
> + */
> +ssize_t cxl_read_adapter_vpd(struct pci_dev *afu_dev, void *buf, size_t count);
> +
>   #endif /* _MISC_CXL_H */
>

      parent reply	other threads:[~2016-03-04 11:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-19 17:14 [PATCH] cxl: Add cxl_read_adapter_vpd() to the kernel API Frederic Barrat
2016-01-20  0:24 ` Andrew Donnellan
2016-01-20  2:20 ` Michael Neuling
2016-01-21 18:48   ` Frederic Barrat
2016-01-22  0:38     ` Michael Neuling
2016-01-22 10:56       ` Frederic Barrat
2016-01-20  2:21 ` Ian Munsie
2016-03-04 11:22 ` Frederic Barrat [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=56D97013.2010703@linux.vnet.ibm.com \
    --to=fbarrat@linux.vnet.ibm.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.