diff mbox series

bus: omap_l3_smx: identify timeout source before rebooting

Message ID 20230730202240.898519-1-absicsz@gmail.com (mailing list archive)
State New, archived
Headers show
Series bus: omap_l3_smx: identify timeout source before rebooting | expand

Commit Message

Sicelo July 30, 2023, 8:22 p.m. UTC
Identify and print the error source before rebooting the board due to an l3
application timeout error, by delaying the BUG_ON. This is helpful when
debugging, e.g. via serial.

Signed-off-by: Sicelo A. Mhlongo <absicsz@gmail.com>
---
 drivers/bus/omap_l3_smx.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

Comments

Tony Lindgren July 31, 2023, 5:29 a.m. UTC | #1
* Sicelo A. Mhlongo <absicsz@gmail.com> [230730 20:23]:
> Identify and print the error source before rebooting the board due to an l3
> application timeout error, by delaying the BUG_ON. This is helpful when
> debugging, e.g. via serial.

Makes sense to try to show some information, but please see the question
below.

> diff --git a/drivers/bus/omap_l3_smx.c b/drivers/bus/omap_l3_smx.c
> index bb1606f5ce2d..70f4903d5468 100644
> --- a/drivers/bus/omap_l3_smx.c
> +++ b/drivers/bus/omap_l3_smx.c
> @@ -170,11 +170,9 @@ static irqreturn_t omap3_l3_app_irq(int irq, void *_l3)
>  		status = omap3_l3_readll(l3->rt, L3_SI_FLAG_STATUS_0);
>  		/*
>  		 * if we have a timeout error, there's nothing we can
> -		 * do besides rebooting the board. So let's BUG on any
> -		 * of such errors and handle the others. timeout error
> -		 * is severe and not expected to occur.
> +		 * do besides rebooting the board after identifying the
> +		 * error source.
>  		 */
> -		BUG_ON(status & L3_STATUS_0_TIMEOUT_MASK);
>  	} else {
>  		status = omap3_l3_readll(l3->rt, L3_SI_FLAG_STATUS_1);
>  		/* No timeout error for debug sources */
> @@ -190,6 +188,12 @@ static irqreturn_t omap3_l3_app_irq(int irq, void *_l3)
>  		ret |= omap3_l3_block_irq(l3, error, error_addr);
>  	}
>  
> +	/*
> +	 * BUG on application timeout errors since they are severe and not
> +	 * expected to occur.
> +	 */
> +	BUG_ON(status & L3_STATUS_0_TIMEOUT_MASK);

Aren't you now checking the bit for both L3_SI_FLAG_STATUS_0 and
L3_SI_FLAG_STATUS_1 register values? I think it should be only for register
L3_SI_FLAG_STATUS_0 value?

Regards,

Tony
Sicelo July 31, 2023, 8:05 a.m. UTC | #2
Hi,

On Mon, Jul 31, 2023 at 08:29:04AM +0300, Tony Lindgren wrote:
> * Sicelo A. Mhlongo <absicsz@gmail.com> [230730 20:23]:
> > Identify and print the error source before rebooting the board due to an l3
> > application timeout error, by delaying the BUG_ON. This is helpful when
> > debugging, e.g. via serial.
> 
> Makes sense to try to show some information, but please see the question
> below.
> 
> > diff --git a/drivers/bus/omap_l3_smx.c b/drivers/bus/omap_l3_smx.c
> > index bb1606f5ce2d..70f4903d5468 100644
> > --- a/drivers/bus/omap_l3_smx.c
> > +++ b/drivers/bus/omap_l3_smx.c
> > @@ -170,11 +170,9 @@ static irqreturn_t omap3_l3_app_irq(int irq, void *_l3)
> >  		status = omap3_l3_readll(l3->rt, L3_SI_FLAG_STATUS_0);
> >  		/*
> >  		 * if we have a timeout error, there's nothing we can
> > -		 * do besides rebooting the board. So let's BUG on any
> > -		 * of such errors and handle the others. timeout error
> > -		 * is severe and not expected to occur.
> > +		 * do besides rebooting the board after identifying the
> > +		 * error source.
> >  		 */
> > -		BUG_ON(status & L3_STATUS_0_TIMEOUT_MASK);
> >  	} else {
> >  		status = omap3_l3_readll(l3->rt, L3_SI_FLAG_STATUS_1);
> >  		/* No timeout error for debug sources */
> > @@ -190,6 +188,12 @@ static irqreturn_t omap3_l3_app_irq(int irq, void *_l3)
> >  		ret |= omap3_l3_block_irq(l3, error, error_addr);
> >  	}
> >  
> > +	/*
> > +	 * BUG on application timeout errors since they are severe and not
> > +	 * expected to occur.
> > +	 */
> > +	BUG_ON(status & L3_STATUS_0_TIMEOUT_MASK);
> 
> Aren't you now checking the bit for both L3_SI_FLAG_STATUS_0 and
> L3_SI_FLAG_STATUS_1 register values? I think it should be only for register
> L3_SI_FLAG_STATUS_0 value?
> 

Ah, you are right. It should be:

    `BUG_ON(!int_type && status & L3_STATUS_0_TIMEOUT_MASK);`

I'll send in a v2.

Thanks
Sicelo
diff mbox series

Patch

diff --git a/drivers/bus/omap_l3_smx.c b/drivers/bus/omap_l3_smx.c
index bb1606f5ce2d..70f4903d5468 100644
--- a/drivers/bus/omap_l3_smx.c
+++ b/drivers/bus/omap_l3_smx.c
@@ -170,11 +170,9 @@  static irqreturn_t omap3_l3_app_irq(int irq, void *_l3)
 		status = omap3_l3_readll(l3->rt, L3_SI_FLAG_STATUS_0);
 		/*
 		 * if we have a timeout error, there's nothing we can
-		 * do besides rebooting the board. So let's BUG on any
-		 * of such errors and handle the others. timeout error
-		 * is severe and not expected to occur.
+		 * do besides rebooting the board after identifying the
+		 * error source.
 		 */
-		BUG_ON(status & L3_STATUS_0_TIMEOUT_MASK);
 	} else {
 		status = omap3_l3_readll(l3->rt, L3_SI_FLAG_STATUS_1);
 		/* No timeout error for debug sources */
@@ -190,6 +188,12 @@  static irqreturn_t omap3_l3_app_irq(int irq, void *_l3)
 		ret |= omap3_l3_block_irq(l3, error, error_addr);
 	}
 
+	/*
+	 * BUG on application timeout errors since they are severe and not
+	 * expected to occur.
+	 */
+	BUG_ON(status & L3_STATUS_0_TIMEOUT_MASK);
+
 	/* Clear the status register */
 	clear = (L3_AGENT_STATUS_CLEAR_IA << int_type) |
 		L3_AGENT_STATUS_CLEAR_TA;