Skip to content

Commit

Permalink
npu2: Improve log output of GPU-to-link mapping
Browse files Browse the repository at this point in the history
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@linux.ibm.com>
Reviewed-by: Alistair Popple <alistair@popple.id.au>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
  • Loading branch information
rarbab authored and stewartsmith committed Apr 20, 2018
1 parent df62a03 commit 58b1e05
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions hw/npu2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 58b1e05

Please sign in to comment.