Skip to content

Commit 30db445

Browse files
tmuehlbachermarckleinebudde
authored andcommitted
can: sja1000: fix max irq loop handling
Reading the interrupt register `SJA1000_IR` causes all of its bits to be reset. If we ever reach the condition of handling more than `SJA1000_MAX_IRQ` IRQs, we will have read the register and reset all its bits but without actually handling the interrupt inside of the loop body. This may, among other issues, cause us to never `netif_wake_queue()` again after a transmission interrupt. Fixes: 429da1c ("can: Driver for the SJA1000 CAN controller") Cc: stable@vger.kernel.org Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net> Acked-by: Oliver Hartkopp <socketcan@hartkopp.net> Link: https://patch.msgid.link/20251115153437.11419-1-tmuehlbacher@posteo.net Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
1 parent 0c73772 commit 30db445

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/net/can/sja1000/sja1000.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -548,8 +548,8 @@ irqreturn_t sja1000_interrupt(int irq, void *dev_id)
548548
if (priv->read_reg(priv, SJA1000_IER) == IRQ_OFF)
549549
goto out;
550550

551-
while ((isrc = priv->read_reg(priv, SJA1000_IR)) &&
552-
(n < SJA1000_MAX_IRQ)) {
551+
while ((n < SJA1000_MAX_IRQ) &&
552+
(isrc = priv->read_reg(priv, SJA1000_IR))) {
553553

554554
status = priv->read_reg(priv, SJA1000_SR);
555555
/* check for absent controller due to hw unplug */

0 commit comments

Comments
 (0)