[Skiboot] [PATCH 1/2] nvlink: Set slot information in npu_dev

Russell Currey ruscur at russell.cc
Mon May 23 14:43:24 AEST 2016


Now that slot information is available for NPUs, it is set on the PCI
device of a NPU link, but not on the link (npu_dev) itself.  The npu_dev
doesn't store a reference to its PCI device, only to the device of the
physical GPU after association.  To make slot information available on a
npu_dev, set it to use the slot information of its PCI device, which is
set by generic PCI code.

Signed-off-by: Russell Currey <ruscur at russell.cc>
---
 hw/npu.c      | 3 +++
 include/npu.h | 2 ++
 2 files changed, 5 insertions(+)

diff --git a/hw/npu.c b/hw/npu.c
index 79b232a..476a1d2 100644
--- a/hw/npu.c
+++ b/hw/npu.c
@@ -598,6 +598,9 @@ static int npu_dn_fixup(struct phb *phb,
 	if (dev->phb || dev->pd)
 		return 0;
 
+	/* Generic PCI code assigns slot info to the pd, give it to the NPU */
+	dev->slot_info = pd->slot_info;
+
 	/* Bind the emulated PCI device with the real one, which can't
 	 * be done until the PCI devices are populated. Once the real
 	 * PCI device is identified, we also need fix the device-tree
diff --git a/include/npu.h b/include/npu.h
index ff6201e..ae94bb0 100644
--- a/include/npu.h
+++ b/include/npu.h
@@ -148,6 +148,8 @@ struct npu_dev {
 	uint32_t		procedure_status;
 
 	uint8_t			pe_num;
+
+	struct pci_slot_info	*slot_info;
 };
 
 /* NPU PHB descriptor */
-- 
2.8.2



More information about the Skiboot mailing list