Skip to content

Commit 55f85dd

Browse files
yf13lupyuen
authored andcommitted
drivers/ctucan: fix IRQ ctrl
This revises the post-IRQ interruption control logic so that to balance the disable/enable operations for both chardev and socketcan cases. Checked with chardev/socketcan on qemu-intel64. Signed-off-by: Yanfeng Liu <[email protected]>
1 parent fcbd309 commit 55f85dd

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

drivers/can/ctucanfd_pci.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -970,9 +970,10 @@ static void ctucanfd_chardev_interrupt(FAR struct ctucanfd_driver_s *priv)
970970

971971
ctucanfd_putreg(&priv->devs[i], CTUCANFD_INTSTAT, stat);
972972

973-
/* Re-enable RX interrupts */
973+
/* Re-enable RX/TX interrupts */
974974

975975
ctucanfd_rxint(&priv->devs[i], true);
976+
ctucanfd_txint(&priv->devs[i], true);
976977
}
977978
}
978979
#endif /* CONFIG_CAN_CTUCANFD_CHARDEV */
@@ -1680,9 +1681,10 @@ static void ctucanfd_sock_interrupt_work(FAR void *arg)
16801681

16811682
ctucanfd_putreg(&priv->devs[i], CTUCANFD_INTSTAT, stat);
16821683

1683-
/* Re-enable RX interrupts */
1684+
/* Re-enable RX/TX interrupts */
16841685

16851686
ctucanfd_rxint(&priv->devs[i], true);
1687+
ctucanfd_txint(&priv->devs[i], true);
16861688
}
16871689
}
16881690
#endif /* CONFIG_CAN_CTUCANFD_SOCKET */
@@ -1711,9 +1713,10 @@ static int ctucanfd_interrupt(int irq, FAR void *context, FAR void *arg)
17111713

17121714
if (regval != 0)
17131715
{
1714-
/* Disable RX interrupts until we handle all interrupts */
1716+
/* Disable RX/TX interrupts until we are done */
17151717

17161718
ctucanfd_rxint(&priv->devs[i], false);
1719+
ctucanfd_txint(&priv->devs[i], false);
17171720

17181721
break;
17191722
}

0 commit comments

Comments
 (0)