Skip to content

Commit 76544be

Browse files
can: sun4i_can: sun4i_can_interrupt(): fix max irq loop handling
Reading the interrupt register `SUN4I_REG_INT_ADDR` causes all of its bits to be reset. If we ever reach the condition of handling more than `SUN4I_CAN_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: 0738eff ("can: Allwinner A10/A20 CAN Controller support - Kernel module") Cc: stable@vger.kernel.org Co-developed-by: Thomas Mühlbacher <tmuehlbacher@posteo.net> Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net> Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com> Link: https://patch.msgid.link/20251116-sun4i-fix-loop-v1-1-3d76d3f81950@pengutronix.de Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
1 parent 6d54799 commit 76544be

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/net/can/sun4i_can.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -657,8 +657,8 @@ static irqreturn_t sun4i_can_interrupt(int irq, void *dev_id)
657657
u8 isrc, status;
658658
int n = 0;
659659

660-
while ((isrc = readl(priv->base + SUN4I_REG_INT_ADDR)) &&
661-
(n < SUN4I_CAN_MAX_IRQ)) {
660+
while ((n < SUN4I_CAN_MAX_IRQ) &&
661+
(isrc = readl(priv->base + SUN4I_REG_INT_ADDR))) {
662662
n++;
663663
status = readl(priv->base + SUN4I_REG_STA_ADDR);
664664

0 commit comments

Comments
 (0)