@@ -208,20 +208,19 @@ static struct pci_controller_ops cxl_pci_controller_ops =intcxl_pci_vphb_add(structcxl_afu*afu){-structpci_dev*phys_dev;-structpci_controller*phb,*phys_phb;+structpci_controller*phb;structdevice_node*vphb_dn;structdevice*parent;-if(cpu_has_feature(CPU_FTR_HVMODE)){-phys_dev=to_pci_dev(afu->adapter->dev.parent);-phys_phb=pci_bus_to_host(phys_dev->bus);-vphb_dn=phys_phb->dn;-parent=&phys_dev->dev;-}else{-vphb_dn=afu->adapter->dev.parent->of_node;-parent=afu->adapter->dev.parent;-}+/* The parent device is the adapter. Reuse the device node of+*theadapter.+*Wedon'tseemtocarewhatdevicenodeisusedforthevPHB,+*buttoolssuchaslsvpdwalkupthedeviceparentslooking+*foravalidlocationcode,sowemightaswellshowdevices+*attachedtotheadapterasbeinglocatedonthatadapter.+*/+parent=afu->adapter->dev.parent;+vphb_dn=parent->of_node;/* Alloc and setup PHB data structure */phb=pcibios_alloc_controller(vphb_dn);
From: Ian Munsie <hidden> Date: 2016-06-15 21:53:57
This could probably use a description in the commit message, perhaps
including output showing the before/after difference this makes to
lsvpd, but otherwise it looks fine to me.
@Mikey - this look OK to you?
Acked-by: Ian Munsie <redacted>
Excerpts from Frederic Barrat's message of 2016-06-15 16:42:16 +0200:
quoted hunk
Tested by cxlflash on bare-metal and powerVM.
Signed-off-by: Frederic Barrat <redacted>
---
drivers/misc/cxl/vphb.c | 21 ++++++++++-----------
1 file changed, 10 insertions(+), 11 deletions(-)
@@ -208,20 +208,19 @@ static struct pci_controller_ops cxl_pci_controller_ops =intcxl_pci_vphb_add(structcxl_afu*afu){-structpci_dev*phys_dev;-structpci_controller*phb,*phys_phb;+structpci_controller*phb;structdevice_node*vphb_dn;structdevice*parent;-if(cpu_has_feature(CPU_FTR_HVMODE)){-phys_dev=to_pci_dev(afu->adapter->dev.parent);-phys_phb=pci_bus_to_host(phys_dev->bus);-vphb_dn=phys_phb->dn;-parent=&phys_dev->dev;-}else{-vphb_dn=afu->adapter->dev.parent->of_node;-parent=afu->adapter->dev.parent;-}+/* The parent device is the adapter. Reuse the device node of+*theadapter.+*Wedon'tseemtocarewhatdevicenodeisusedforthevPHB,+*buttoolssuchaslsvpdwalkupthedeviceparentslooking+*foravalidlocationcode,sowemightaswellshowdevices+*attachedtotheadapterasbeinglocatedonthatadapter.+*/+parent=afu->adapter->dev.parent;+vphb_dn=parent->of_node;/* Alloc and setup PHB data structure */phb=pcibios_alloc_controller(vphb_dn);
Thanks, Ian. Here is a hopefully better commit message:
cxl: Make vPHB device node match adapter's
On bare-metal, when a device is attached to the cxl card, lsvpd shows
a location code such as (with cxlflash):
# lsvpd -l sg22
...
*YL U78CB.001.WZS0073-P1-C33-B0-T0-L0
which makes it hard to easily identify the cxl adapter owning the
flash device, since in this example C33 refers to a P8 processor.
lsvpd looks in the parent devices until it finds a location code, so the
device node for the vPHB ends up being used.
By reusing the device node of the adapter for the vPHB, lsvpd shows:
# lsvpd -l sg16
...
*YL U78C9.001.WZS09XA-P1-C7-B1-T0-L3
where C7 is the PCI slot of the cxl adapter.
On powerVM, the vPHB was already using the adapter device node, so
there's no change there.
Tested by cxlflash on bare-metal and powerVM.
Signed-off-by: Frederic Barrat <redacted>
Le 15/06/2016 23:53, Ian Munsie a écrit :
This could probably use a description in the commit message, perhaps
including output showing the before/after difference this makes to
lsvpd, but otherwise it looks fine to me.
@Mikey - this look OK to you?
Acked-by: Ian Munsie <redacted>
Excerpts from Frederic Barrat's message of 2016-06-15 16:42:16 +0200:
quoted
Tested by cxlflash on bare-metal and powerVM.
Signed-off-by: Frederic Barrat <redacted>
---
drivers/misc/cxl/vphb.c | 21 ++++++++++-----------
1 file changed, 10 insertions(+), 11 deletions(-)
@@ -208,20 +208,19 @@ static struct pci_controller_ops cxl_pci_controller_ops =intcxl_pci_vphb_add(structcxl_afu*afu){-structpci_dev*phys_dev;-structpci_controller*phb,*phys_phb;+structpci_controller*phb;structdevice_node*vphb_dn;structdevice*parent;-if(cpu_has_feature(CPU_FTR_HVMODE)){-phys_dev=to_pci_dev(afu->adapter->dev.parent);-phys_phb=pci_bus_to_host(phys_dev->bus);-vphb_dn=phys_phb->dn;-parent=&phys_dev->dev;-}else{-vphb_dn=afu->adapter->dev.parent->of_node;-parent=afu->adapter->dev.parent;-}+/* The parent device is the adapter. Reuse the device node of+*theadapter.+*Wedon'tseemtocarewhatdevicenodeisusedforthevPHB,+*buttoolssuchaslsvpdwalkupthedeviceparentslooking+*foravalidlocationcode,sowemightaswellshowdevices+*attachedtotheadapterasbeinglocatedonthatadapter.+*/+parent=afu->adapter->dev.parent;+vphb_dn=parent->of_node;/* Alloc and setup PHB data structure */phb=pcibios_alloc_controller(vphb_dn);
From: Michael Neuling <hidden> Date: 2016-06-17 03:45:10
On Thu, 2016-06-16 at 07:53 +1000, Ian Munsie wrote:
This could probably use a description in the commit message, perhaps
including output showing the before/after difference this makes to
lsvpd, but otherwise it looks fine to me.
=20
@Mikey - this look OK to you?
Yeah I think this is a good idea.
IIRC, we had something like this really early on but hit some random issue
and pulled it out before posting.
Mikey
Acked-by: Ian Munsie <redacted>
=20
Excerpts from Frederic Barrat's message of 2016-06-15 16:42:16 +0200:
quoted
=20
Tested by cxlflash on bare-metal and powerVM.
=20
Signed-off-by: Frederic Barrat <redacted>
---
=C2=A0drivers/misc/cxl/vphb.c | 21 ++++++++++-----------
=C2=A01 file changed, 10 insertions(+), 11 deletions(-)
=20
From: Michael Ellerman <mpe@ellerman.id.au> Date: 2016-06-21 00:40:52
On Wed, 2016-15-06 at 14:42:16 UTC, Frederic Barrat wrote:
Tested by cxlflash on bare-metal and powerVM.
Signed-off-by: Frederic Barrat <redacted>
Reviewed-by: Matthew R. Ochs <redacted>
Acked-by: Ian Munsie <redacted>
Signed-off-by: Frederic Barrat <redacted>