aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReza Arbab <arbab@linux.vnet.ibm.com>2017-11-21 17:42:45 -0600
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-11-21 21:05:06 -0600
commit1c5417ec1898dbdd072495913d7fbc657e570e6f (patch)
tree86ab7a68af1859f45e2040e86e49a6825e004395
parent1172a6c57ff3c66f6361e572a1790cbcc0e5ff37 (diff)
downloadskiboot-1c5417ec1898dbdd072495913d7fbc657e570e6f.zip
skiboot-1c5417ec1898dbdd072495913d7fbc657e570e6f.tar.gz
skiboot-1c5417ec1898dbdd072495913d7fbc657e570e6f.tar.bz2
npu2: Print bdfn in NPU2DEV* logging macros
Revise the NPU2DEV{DBG,INF,ERR} logging macros to include the device's bdfn. It's useful to know exactly which link we're referring to. For instance, instead of [ 234.044921238,6] NPU6: Starting procedure reset_ntl [ 234.048578101,6] NPU6: Starting procedure reset_ntl [ 234.051049676,6] NPU6: Starting procedure reset_ntl [ 234.053503542,6] NPU6: Starting procedure reset_ntl [ 234.057182864,6] NPU6: Starting procedure reset_ntl [ 234.059666137,6] NPU6: Starting procedure reset_ntl we'll get [ 234.044921238,6] NPU6:0:0.0 Starting procedure reset_ntl [ 234.048578101,6] NPU6:0:0.1 Starting procedure reset_ntl [ 234.051049676,6] NPU6:0:0.2 Starting procedure reset_ntl [ 234.053503542,6] NPU6:0:1.0 Starting procedure reset_ntl [ 234.057182864,6] NPU6:0:1.1 Starting procedure reset_ntl [ 234.059666137,6] NPU6:0:1.2 Starting procedure reset_ntl Signed-off-by: Reza Arbab <arbab@linux.vnet.ibm.com> Acked-by: Alistair Popple <alistair@popple.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
-rw-r--r--include/npu2.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/include/npu2.h b/include/npu2.h
index 3b56f48..dae152a 100644
--- a/include/npu2.h
+++ b/include/npu2.h
@@ -27,9 +27,14 @@
#define NPU2ERR(p, fmt, a...) prlog(PR_ERR, "NPU%d: " fmt, \
(p)->phb.opal_id, ##a)
-#define NPU2DEVDBG(p, fmt, a...) NPU2DBG((p)->npu, fmt, ##a)
-#define NPU2DEVINF(p, fmt, a...) NPU2INF((p)->npu, fmt, ##a)
-#define NPU2DEVERR(p, fmt, a...) NPU2ERR((p)->npu, fmt, ##a)
+#define NPU2DEVLOG(l, p, fmt, a...) prlog(l, "NPU%d:%d:%d.%d " fmt, \
+ (p)->npu->phb.opal_id, \
+ ((p)->bdfn >> 8) & 0xff, \
+ ((p)->bdfn >> 3) & 0x1f, \
+ (p)->bdfn & 0x7, ##a)
+#define NPU2DEVDBG(p, fmt, a...) NPU2DEVLOG(PR_DEBUG, p, fmt, ##a)
+#define NPU2DEVINF(p, fmt, a...) NPU2DEVLOG(PR_INFO, p, fmt, ##a)
+#define NPU2DEVERR(p, fmt, a...) NPU2DEVLOG(PR_ERR, p, fmt, ##a)
/* Number of PEs supported */
#define NPU2_MAX_PE_NUM 16