FSI master tracepoints
Subsystems (3)
Joel Stanley
maintainercover FSI master tracepoints
The first patch removes the base pointer from the tracepoint which I don't think is useful.
The second adds a tracepoint for some status registers when an error occurs.
Joel Stanley (2):
fsi: aspeed: Remove base from trace
fsi: aspeed: Add trace when error occurs
drivers/fsi/fsi-master-aspeed.c | 12 ++++++-- include/trace/events/fsi_master_aspeed.h | 38 ++++++++++++++++-------- 2 files changed, 35 insertions(+), 15 deletions(-)
Signature · 1 line
2.23.0
Joel Stanley
maintainerPATCH 1/2 fsi: aspeed: Remove base from trace
The base was showing the virtual address of the FSI master, which was not useful for most users of the tracepoint.
--- drivers/fsi/fsi-master-aspeed.c | 5 ++--- include/trace/events/fsi_master_aspeed.h | 20 ++++++++------------ 2 files changed, 10 insertions(+), 15 deletions(-)
drivers/fsi/fsi-master-aspeed.c +2 -3
@@ -194,8 +194,7 @@ static u32 opb_write(void __iomem *base, uint32_t addr, uint32_t val, status =readl (base +OPB0_STATUS ); -trace_fsi_master_aspeed_opb_write (base, addr, val, size, - status, reg); +trace_fsi_master_aspeed_opb_write (addr, val, size, status, reg);/* Return error when poll timed out */ if (ret)
@@ -231,7 +230,7 @@ static int opb_read(void __iomem *base, uint32_t addr, size_t size, u32 *out) result =readl (base +OPB0_FSI_DATA_R ); -trace_fsi_master_aspeed_opb_read (base, addr, size, result, +trace_fsi_master_aspeed_opb_read (addr, size, result,readl (base +OPB0_STATUS ), reg);
include/trace/events/fsi_master_aspeed.h +8 -12
@@ -9,10 +9,9 @@#include <linux/tracepoint.h> TRACE_EVENT(fsi_master_aspeed_opb_read, - TP_PROTO(void __iomem *base, uint32_t addr, size_t size, uint32_t result, uint32_t status, uint32_t irq_status), - TP_ARGS(base, addr, size, result, status, irq_status), + TP_PROTO(uint32_t addr, size_t size, uint32_t result, uint32_t status, uint32_t irq_status), + TP_ARGS(addr, size, result, status, irq_status), TP_STRUCT__entry( - __field(void *, base) __field(uint32_t, addr) __field(size_t, size) __field(uint32_t, result)
@@ -20,24 +19,22 @@ TRACE_EVENT(fsi_master_aspeed_opb_read,__field (uint32_t, irq_status) ),TP_fast_assign ( - __entry->base = base; __entry->addr = addr; __entry->size = size; __entry->result = result; __entry->status = status; __entry->irq_status = irq_status; ), -TP_printk ("fsi: opb read: base %p addr %08x size %zu: result %08x status: %08x irq_status: %08x" , - __entry->base, __entry->addr, __entry->size, __entry->result, +TP_printk ("fsi: opb read: addr %08x size %zu: result %08x status: %08x irq_status: %08x" , + __entry->addr, __entry->size, __entry->result, __entry->status, __entry->irq_status ) ); TRACE_EVENT(fsi_master_aspeed_opb_write, - TP_PROTO(void __iomem *base, uint32_t addr, uint32_t val, size_t size, uint32_t status, uint32_t irq_status), - TP_ARGS(base, addr, val, size, status, irq_status), + TP_PROTO(uint32_t addr, uint32_t val, size_t size, uint32_t status, uint32_t irq_status), + TP_ARGS(addr, val, size, status, irq_status), TP_STRUCT__entry( - __field(void *, base) __field(uint32_t, addr) __field(uint32_t, val) __field(size_t, size)
@@ -45,15 +42,14 @@ TRACE_EVENT(fsi_master_aspeed_opb_write,__field (uint32_t, irq_status) ),TP_fast_assign ( - __entry->base = base; __entry->addr = addr; __entry->val = val; __entry->size = size; __entry->status = status; __entry->irq_status = irq_status; ), -TP_printk ("fsi: opb write: base %p addr %08x val %08x size %zu status: %08x irq_status: %08x" , - __entry->base, __entry->addr, __entry->val, __entry->size, +TP_printk ("fsi: opb write: addr %08x val %08x size %zu status: %08x irq_status: %08x" , + __entry->addr, __entry->val, __entry->size, __entry->status, __entry->irq_status ) );
Signature · 1 line
2.23.0
Re: [PATCH linux dev-5.3 1/2] fsi: aspeed: Remove base from trace
Quoted 2 lines · Joel Stanley
The base was showing the virtual address of the FSI master, which was not useful for most users of the tracepoint.
Quoted 94 lines
Signed-off-by Joel Stanley <[email protected]>--- drivers/fsi/fsi-master-aspeed.c | 5 ++--- include/trace/events/fsi_master_aspeed.h | 20 ++++++++------------ 2 files changed, 10 insertions(+), 15 deletions(-)drivers/fsi/fsi-master-aspeed.c +2
-3@@ -194,8 +194,7 @@ static u32 opb_write(void __iomem *base, uint32_t addr, uint32_t val, status =readl (base +OPB0_STATUS ); -trace_fsi_master_aspeed_opb_write (base, addr, val, size, - status, reg); +trace_fsi_master_aspeed_opb_write (addr, val, size, status, reg);/* Return error when poll timed out */ if (ret)@@ -231,7 +230,7 @@ static int opb_read(void __iomem *base, uint32_t addr, size_t size, u32 *out) result =readl (base +OPB0_FSI_DATA_R ); -trace_fsi_master_aspeed_opb_read (base, addr, size, result, +trace_fsi_master_aspeed_opb_read (addr, size, result,readl (base +OPB0_STATUS ), reg);include/trace/events/fsi_master_aspeed.h +8
-12@@ -9,10 +9,9 @@#include <linux/tracepoint.h> TRACE_EVENT(fsi_master_aspeed_opb_read, - TP_PROTO(void __iomem *base, uint32_t addr, size_t size, uint32_t result, uint32_t status, uint32_t irq_status), - TP_ARGS(base, addr, size, result, status, irq_status), + TP_PROTO(uint32_t addr, size_t size, uint32_t result, uint32_t status, uint32_t irq_status), + TP_ARGS(addr, size, result, status, irq_status), TP_STRUCT__entry( - __field(void *, base) __field(uint32_t, addr) __field(size_t, size) __field(uint32_t, result)@@ -20,24 +19,22 @@ TRACE_EVENT(fsi_master_aspeed_opb_read,__field (uint32_t, irq_status) ),TP_fast_assign ( - __entry->base = base; __entry->addr = addr; __entry->size = size; __entry->result = result; __entry->status = status; __entry->irq_status = irq_status; ), -TP_printk ("fsi: opb read: base %p addr %08x size %zu: result %08x status: %08x irq_status: %08x" , - __entry->base, __entry->addr, __entry->size, __entry->result, +TP_printk ("fsi: opb read: addr %08x size %zu: result %08x status: %08x irq_status: %08x" , + __entry->addr, __entry->size, __entry->result, __entry->status, __entry->irq_status ) ); TRACE_EVENT(fsi_master_aspeed_opb_write, - TP_PROTO(void __iomem *base, uint32_t addr, uint32_t val, size_t size, uint32_t status, uint32_t irq_status), - TP_ARGS(base, addr, val, size, status, irq_status), + TP_PROTO(uint32_t addr, uint32_t val, size_t size, uint32_t status, uint32_t irq_status), + TP_ARGS(addr, val, size, status, irq_status), TP_STRUCT__entry( - __field(void *, base) __field(uint32_t, addr) __field(uint32_t, val) __field(size_t, size)@@ -45,15 +42,14 @@ TRACE_EVENT(fsi_master_aspeed_opb_write,__field (uint32_t, irq_status) ),TP_fast_assign ( - __entry->base = base; __entry->addr = addr; __entry->val = val; __entry->size = size; __entry->status = status; __entry->irq_status = irq_status; ), -TP_printk ("fsi: opb write: base %p addr %08x val %08x size %zu status: %08x irq_status: %08x" , - __entry->base, __entry->addr, __entry->val, __entry->size, +TP_printk ("fsi: opb write: addr %08x val %08x size %zu status: %08x irq_status: %08x" , + __entry->addr, __entry->val, __entry->size, __entry->status, __entry->irq_status ) );
Re: [PATCH linux dev-5.3 1/2] fsi: aspeed: Remove base from trace
In reply to Joel StanleyQuoted 4 lines · Joel Stanley
The base was showing the virtual address of the FSI master, which was not useful for most users of the tracepoint.
Signed-off-by Joel Stanley <[email protected]>
Joel Stanley
maintainerPATCH 2/2 fsi: aspeed: Add trace when error occurs
In reply to Joel StanleyThis prints out three registers in the FSI master when an error occurs.
--- drivers/fsi/fsi-master-aspeed.c | 7 +++++++ include/trace/events/fsi_master_aspeed.h | 18 ++++++++++++++++++ 2 files changed, 25 insertions(+)
drivers/fsi/fsi-master-aspeed.c +7 -0
@@ -251,6 +251,13 @@ static int opb_read(void __iomem *base, uint32_t addr, size_t size, u32 *out)static int check_errors (struct fsi_master_aspeed *aspeed,int err) {int ret; +u32 mresp0, mstap0, mesrb0; + +opb_read (aspeed->base, ctrl_base +FSI_MRESP0 ,4 , &mresp0); +opb_read (aspeed->base, ctrl_base +FSI_MSTAP0 ,4 , &mstap0); +opb_read (aspeed->base, ctrl_base +FSI_MESRB0 ,4 , &mesrb0); + +trace_fsi_master_aspeed_opb_error (mresp0, mstap0, mesrb0);if (err == -EIO ) {/* Check MAEB (0x70) ? */
include/trace/events/fsi_master_aspeed.h +18 -0
@@ -54,6 +54,24 @@ TRACE_EVENT(fsi_master_aspeed_opb_write, ) ); +TRACE_EVENT (fsi_master_aspeed_opb_error, + TP_PROTO(uint32_t mresp0, uint32_t mstap0, uint32_t mesrb0), +TP_ARGS (mresp0, mstap0, mesrb0), +TP_STRUCT__entry ( + __field(uint32_t, mresp0) + __field(uint32_t, mstap0) +__field (uint32_t, mesrb0) + ), +TP_fast_assign ( + __entry->mresp0 = mresp0; + __entry->mstap0 = mstap0; + __entry->mesrb0 = mesrb0; + ), +TP_printk ("mresp0 %08x mstap0 %08x mesrb0 %08x" , + __entry->mresp0, __entry->mstap0, __entry->mesrb0 + ) + ); +#endif #include <trace/define_trace.h>
Signature · 1 line
2.23.0
Re: [PATCH linux dev-5.3 2/2] fsi: aspeed: Add trace when error occurs
Quoted 1 line · Joel Stanley
This prints out three registers in the FSI master when an error occurs.
Quoted 54 lines
Signed-off-by Joel Stanley <[email protected]>--- drivers/fsi/fsi-master-aspeed.c | 7 +++++++ include/trace/events/fsi_master_aspeed.h | 18 ++++++++++++++++++ 2 files changed, 25 insertions(+)drivers/fsi/fsi-master-aspeed.c +7
-0@@ -251,6 +251,13 @@ static int opb_read(void __iomem *base, uint32_t addr, size_t size, u32 *out)static int check_errors (struct fsi_master_aspeed *aspeed,int err) {int ret; +u32 mresp0, mstap0, mesrb0; + +opb_read (aspeed->base, ctrl_base +FSI_MRESP0 ,4 , &mresp0); +opb_read (aspeed->base, ctrl_base +FSI_MSTAP0 ,4 , &mstap0); +opb_read (aspeed->base, ctrl_base +FSI_MESRB0 ,4 , &mesrb0); + +trace_fsi_master_aspeed_opb_error (mresp0, mstap0, mesrb0);if (err == -EIO ) {/* Check MAEB (0x70) ? */ include/trace/events/fsi_master_aspeed.h +18
-0@@ -54,6 +54,24 @@ TRACE_EVENT(fsi_master_aspeed_opb_write, ) ); +TRACE_EVENT (fsi_master_aspeed_opb_error, + TP_PROTO(uint32_t mresp0, uint32_t mstap0, uint32_t mesrb0), +TP_ARGS (mresp0, mstap0, mesrb0), +TP_STRUCT__entry ( + __field(uint32_t, mresp0) + __field(uint32_t, mstap0) +__field (uint32_t, mesrb0) + ), +TP_fast_assign ( + __entry->mresp0 = mresp0; + __entry->mstap0 = mstap0; + __entry->mesrb0 = mesrb0; + ), +TP_printk ("mresp0 %08x mstap0 %08x mesrb0 %08x" , + __entry->mresp0, __entry->mstap0, __entry->mesrb0 + ) + ); +#endif #include <trace/define_trace.h>
Re: [PATCH linux dev-5.3 2/2] fsi: aspeed: Add trace when error occurs
In reply to Joel StanleyQuoted 14 lines · Joel Stanley
This prints out three registers in the FSI master when an error occurs.
Signed-off-by Joel Stanley <[email protected]>--- drivers/fsi/fsi-master-aspeed.c | 7 +++++++ include/trace/events/fsi_master_aspeed.h | 18 ++++++++++++++++++ 2 files changed, 25 insertions(+)drivers/fsi/fsi-master-aspeed.c +0
-0
drivers/fsi/fsi-master-aspeed.c static int opb_read(void __iomem *base, uint32_t · line 259
Quoted 9 lines
drivers/fsi/fsi-master-aspeed.c +5
-0@@ -251,6 +251,13 @@ static int opb_read(void __iomem *base, uint32_t addr, size_t size, u32 *out)static int check_errors (struct fsi_master_aspeed *aspeed,int err) {int ret; +u32 mresp0, mstap0, mesrb0; + +opb_read (aspeed->base, ctrl_base +FSI_MRESP0 ,4 , &mresp0); +opb_read (aspeed->base, ctrl_base +FSI_MSTAP0 ,4 , &mstap0); +opb_read (aspeed->base, ctrl_base +FSI_MESRB0 ,4 , &mesrb0);
check_errors() is done unconditionally in the read and write paths, and these reads are unconditionally done on calls to check_error(). Really we only need them if an error has occurred, so I think we should do:
if (trace_fsi_master_aspeed_opb_error_enabled()) {
u32 mresp0, mstap0, mesrb0;
opb_read(aspeed->base, ctrl_base + FSI_MRESP0, 4, &mresp0);
...
trace_fsi_master_aspeed_opb_error(mresp0, mstap0, mesrb0);
}