Thread (6 messages) flat view 6 messages, 5 authors, 2016-06-21

Re: [PATCH] cxl: Make vPHB device node match adapter's

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 ↗ jump to 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(-)
diff --git a/drivers/misc/cxl/vphb.c b/drivers/misc/cxl/vphb.c
index cdc7723..012b6aa 100644
--- a/drivers/misc/cxl/vphb.c
+++ b/drivers/misc/cxl/vphb.c
@@ -208,20 +208,19 @@ static struct pci_controller_ops cxl_pci_controller_ops =
 
 int cxl_pci_vphb_add(struct cxl_afu *afu)
 {
-    struct pci_dev *phys_dev;
-    struct pci_controller *phb, *phys_phb;
+    struct pci_controller *phb;
     struct device_node *vphb_dn;
     struct device *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
+     * the adapter.
+     * We don't seem to care what device node is used for the vPHB,
+     * but tools such as lsvpd walk up the device parents looking
+     * for a valid location code, so we might as well show devices
+     * attached to the adapter as being located on that adapter.
+     */
+    parent = afu->adapter->dev.parent;
+    vphb_dn = parent->of_node;
 
     /* Alloc and setup PHB data structure */
     phb = pcibios_alloc_controller(vphb_dn);
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help