Skip to contentSkip to conversation

bus: omap_l3_smx: identify timeout source before rebooting

PATCH Superseded Sicelo A. Mhlongo 2 participants 2 messages Jul 31, 2023 OMAP2+ support

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 bus: omap_l3_smx: identify timeout source before rebooting

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.

---
 drivers/bus/omap_l3_smx.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/bus/omap_l3_smx.c +8 -4
index bb1606f5ce2d..0ccde12e33c0 100644
@@ -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(!int_type && status & L3_STATUS_0_TIMEOUT_MASK);
+
 	/* Clear the status register */
 	clear = (L3_AGENT_STATUS_CLEAR_IA << int_type) |
 		L3_AGENT_STATUS_CLEAR_TA;
Signature · 1 line
2.40.1
#1 lore raw

Hi,

Quoted 17 lines · Sicelo A. Mhlongo

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.

---
 drivers/bus/omap_l3_smx.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/bus/omap_l3_smx.c +0 -0
index bb1606f5ce2d..0ccde12e33c0 100644
@@ -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

drivers/bus/omap_l3_smx.c static irqreturn_t omap3_l3_app_irq(int irq, void *_l3) · line 178

Quoted 10 lines
drivers/bus/omap_l3_smx.c +2 -4
-		 * 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 */

I think it's sensible to just remove the comments from both if/else branches. They no longer make sense in this place. Afterwards you should remove the curly brackets to follow kernel coding style.

drivers/bus/omap_l3_smx.c static irqreturn_t omap3_l3_app_irq(int irq, void *_l3) · line 194

Quoted 8 lines
drivers/bus/omap_l3_smx.c +4 -0
@@ -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.
+	 */

I suggest using the original text. It does mention "there's nothing we can do besides rebooting the board".

drivers/bus/omap_l3_smx.c static irqreturn_t omap3_l3_app_irq(int irq, void *_l3) · line 199

Quoted 5 lines
drivers/bus/omap_l3_smx.c +2 -0
+	BUG_ON(!int_type && status & L3_STATUS_0_TIMEOUT_MASK);
+
 	/* Clear the status register */
 	clear = (L3_AGENT_STATUS_CLEAR_IA << int_type) |
 		L3_AGENT_STATUS_CLEAR_TA;

-- Sebastian