[PATCH linux dev-5.3 2/2] fsi: aspeed: Add trace when error occurs

Eddie James eajames at linux.vnet.ibm.com
Tue Oct 15 05:38:34 AEDT 2019


On 10/14/19 8:21 AM, Joel Stanley wrote:
> This prints out three registers in the FSI master when an error occurs.


Reviewed-by: Eddie James <eajames at linux.ibm.com>

Tested-by: Eddie James <eajames at linux.ibm.com>


>
> Signed-off-by: Joel Stanley <joel at jms.id.au>
> ---
>   drivers/fsi/fsi-master-aspeed.c          |  7 +++++++
>   include/trace/events/fsi_master_aspeed.h | 18 ++++++++++++++++++
>   2 files changed, 25 insertions(+)
>
> diff --git a/drivers/fsi/fsi-master-aspeed.c b/drivers/fsi/fsi-master-aspeed.c
> index d796c4012875..66657b7848de 100644
> --- a/drivers/fsi/fsi-master-aspeed.c
> +++ b/drivers/fsi/fsi-master-aspeed.c
> @@ -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) ? */
> diff --git a/include/trace/events/fsi_master_aspeed.h b/include/trace/events/fsi_master_aspeed.h
> index 63b9ce7f0de6..8e47637c5fb7 100644
> --- a/include/trace/events/fsi_master_aspeed.h
> +++ b/include/trace/events/fsi_master_aspeed.h
> @@ -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>


More information about the openbmc mailing list