From 1c5417ec1898dbdd072495913d7fbc657e570e6f Mon Sep 17 00:00:00 2001 From: Reza Arbab Date: Tue, 21 Nov 2017 17:42:45 -0600 Subject: 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 Acked-by: Alistair Popple Signed-off-by: Stewart Smith --- include/npu2.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'include') 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 -- cgit v1.1