[Skiboot] [PATCH] npu2: Improve log output of GPU-to-link mapping

Reza Arbab arbab at linux.ibm.com
Fri Apr 20 01:52:47 AEST 2018


Debugging issues related to unconnected NVLinks can be a little less
irritating if we use the NPU2DEV{DBG,INF}() macros instead of prlog().

In short, change this:

  NPU2: comparing GPU 'GPU2' and NPU2 'GPU1'
  NPU2: comparing GPU 'GPU3' and NPU2 'GPU1'
  NPU2: comparing GPU 'GPU4' and NPU2 'GPU1'
  NPU2: comparing GPU 'GPU5' and NPU2 'GPU1'
  	:
  npu2_dev_bind_pci_dev: No PCI device for NPU2 device 0006:00:01.0 to bind to. If you expect a GPU to be there, this is a problem.

to this:

  NPU6:0:1.0 Comparing GPU 'GPU2' and NPU2 'GPU1'
  NPU6:0:1.0 Comparing GPU 'GPU3' and NPU2 'GPU1'
  NPU6:0:1.0 Comparing GPU 'GPU4' and NPU2 'GPU1'
  NPU6:0:1.0 Comparing GPU 'GPU5' and NPU2 'GPU1'
  	:
  NPU6:0:1.0 No PCI device found for slot 'GPU1'

Signed-off-by: Reza Arbab <arbab at linux.ibm.com>
---
 hw/npu2.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/hw/npu2.c b/hw/npu2.c
index 4122af9..dc9f220 100644
--- a/hw/npu2.c
+++ b/hw/npu2.c
@@ -400,8 +400,8 @@ static int __npu2_dev_bind_pci_dev(struct phb *phb __unused,
 
 	pcislot = (char *)dt_prop_get(pci_dt_node, "ibm,slot-label");
 
-	prlog(PR_DEBUG, "NPU2: comparing GPU '%s' and NPU2 '%s'\n",
-	      pcislot, dev->nvlink.slot_label);
+	NPU2DEVDBG(dev, "Comparing GPU '%s' and NPU2 '%s'\n",
+		   pcislot, dev->nvlink.slot_label);
 
 	if (streq(pcislot, dev->nvlink.slot_label))
 		return 1;
@@ -434,8 +434,8 @@ static void npu2_dev_bind_pci_dev(struct npu2_dev *dev)
 		}
 	}
 
-	prlog(PR_INFO, "%s: No PCI device for NPU2 device %04x:00:%02x.0 to bind to. If you expect a GPU to be there, this is a problem.\n",
-	      __func__, dev->npu->phb_nvlink.opal_id, dev->index);
+	NPU2DEVINF(dev, "No PCI device found for slot '%s'\n",
+		   dev->nvlink.slot_label);
 }
 
 static struct lock pci_npu_phandle_lock = LOCK_UNLOCKED;
-- 
1.8.3.1



More information about the Skiboot mailing list