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 <redacted>
---
drivers/misc/cxl/api.c | 8 ++++++++
include/misc/cxl.h | 5 +++++
2 files changed, 13 insertions(+)
From: Andrew Donnellan <hidden> Date: 2016-01-20 00:25:38
On 20/01/16 04:14, Frederic Barrat wrote:
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 <redacted>
Looks fine to me.
Reviewed-by: Andrew Donnellan <redacted>
--
Andrew Donnellan Software Engineer, OzLabs
andrew.donnellan@au1.ibm.com Australia Development Lab, Canberra
+61 2 6201 8874 (work) IBM Australia Limited
From: Michael Neuling <hidden> Date: 2016-01-20 02:20:49
On Tue, 2016-01-19 at 18:14 +0100, Frederic Barrat wrote:
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.
This looks good.
The only thing I'm a bit concerned about is are we going to end up
duplicating a lot of the linux PCI API, but I guess we are only going
to do this for things the papr HCALL interface mimics.
Mikey
The only thing I'm a bit concerned about is are we going to end up
duplicating a lot of the linux PCI API, but I guess we are only going
to do this for things the papr HCALL interface mimics.
There are actually very few operations we can do on the adapter with
hcalls. papr defines 'reset', 'read the VPD' and flashing a new image on
the card. So we'll soon run out of APIs to mimic.
I guess it means the usage of cxl_get_phys_dev() should be discouraged,
since it's going to lead to different behaviors between bare-metal and
powerVM guest. Was there another expected use case for a kernel driver
other than accessing the VPD?
Fred
From: Michael Neuling <hidden> Date: 2016-01-22 00:38:50
On Thu, 2016-01-21 at 19:48 +0100, Frederic Barrat wrote:
=20
Le 20/01/2016 03:20, Michael Neuling a =C3=A9crit :
quoted
The only thing I'm a bit concerned about is are we going to end up
duplicating a lot of the linux PCI API, but I guess we are only going
to do this for things the papr HCALL interface mimics.
=20
There are actually very few operations we can do on the adapter with=20
hcalls. papr defines 'reset', 'read the VPD' and flashing a new image on=
=20
the card. So we'll soon run out of APIs to mimic.
=20
I guess it means the usage of cxl_get_phys_dev() should be discouraged,=
=20
since it's going to lead to different behaviors between bare-metal and=
=20
powerVM guest. Was there another expected use case for a kernel driver=
=20
other than accessing the VPD?
It was just for VPD. I figured it was the easiest way to add it. Maybe
it's worth getting rid of it in favour of VPD only.
If you want to remove it I'd be happy, but you'll need to coordinate
with the cxlflash driver. You can probably just write the patch for
them and then get their ACK on it.
Thanks again.
Mikey
On Thu, 2016-01-21 at 19:48 +0100, Frederic Barrat wrote:
quoted
Le 20/01/2016 03:20, Michael Neuling a écrit :
quoted
The only thing I'm a bit concerned about is are we going to end up
duplicating a lot of the linux PCI API, but I guess we are only going
to do this for things the papr HCALL interface mimics.
There are actually very few operations we can do on the adapter with
hcalls. papr defines 'reset', 'read the VPD' and flashing a new image on
the card. So we'll soon run out of APIs to mimic.
I guess it means the usage of cxl_get_phys_dev() should be discouraged,
since it's going to lead to different behaviors between bare-metal and
powerVM guest. Was there another expected use case for a kernel driver
other than accessing the VPD?
It was just for VPD. I figured it was the easiest way to add it. Maybe
it's worth getting rid of it in favour of VPD only.
If you want to remove it I'd be happy, but you'll need to coordinate
with the cxlflash driver. You can probably just write the patch for
them and then get their ACK on it.
Ok, then I would also be tempted to remove it. I'll sync with cxlflash
to do so.
Thanks!
Fred
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 :
quoted hunk
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 <redacted>
---
drivers/misc/cxl/api.c | 8 ++++++++
include/misc/cxl.h | 5 +++++
2 files changed, 13 insertions(+)