aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorWolfgang Grandegger <wg@grandegger.com>2011-12-12 10:09:28 -0500
committerMarc Kleine-Budde <mkl@pengutronix.de>2012-02-02 18:24:50 -0500
commit6e9d554fa6e481a848358c215f129432262123c0 (patch)
tree74929f3f9fe8e3108f214ad28d60bbbb4762ca8b /drivers/net
parentba7605745d5c99f0e71b3ec6c7cb5ed6afe540ad (diff)
can: flexcan: fix irq flooding by clearing all interrupt sources
As pointed out by Reuben Dowle and Lothar Waßmann, the TWRN_INT, RWRN_INT, BOFF_INT interrupt sources need to be cleared as well to avoid interrupt flooding, at least for the Flexcan on i.MX28 SOCs. Furthermore, the interrupts are only cleared, if really one of those interrupt sources are pending (which is not the case for rx and tx done). Cc: Reuben Dowle <Reuben.Dowle@navico.com> Cc: Lothar Waßmann <LW@KARO-electronics.de> Signed-off-by: Wolfgang Grandegger <wg@grandegger.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/can/flexcan.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
index 7fd8089946fb..96d235799ec1 100644
--- a/drivers/net/can/flexcan.c
+++ b/drivers/net/can/flexcan.c
@@ -118,6 +118,9 @@
118 (FLEXCAN_ESR_TWRN_INT | FLEXCAN_ESR_RWRN_INT | FLEXCAN_ESR_BOFF_INT) 118 (FLEXCAN_ESR_TWRN_INT | FLEXCAN_ESR_RWRN_INT | FLEXCAN_ESR_BOFF_INT)
119#define FLEXCAN_ESR_ERR_ALL \ 119#define FLEXCAN_ESR_ERR_ALL \
120 (FLEXCAN_ESR_ERR_BUS | FLEXCAN_ESR_ERR_STATE) 120 (FLEXCAN_ESR_ERR_BUS | FLEXCAN_ESR_ERR_STATE)
121#define FLEXCAN_ESR_ALL_INT \
122 (FLEXCAN_ESR_TWRN_INT | FLEXCAN_ESR_RWRN_INT | \
123 FLEXCAN_ESR_BOFF_INT | FLEXCAN_ESR_ERR_INT)
121 124
122/* FLEXCAN interrupt flag register (IFLAG) bits */ 125/* FLEXCAN interrupt flag register (IFLAG) bits */
123#define FLEXCAN_TX_BUF_ID 8 126#define FLEXCAN_TX_BUF_ID 8
@@ -577,7 +580,9 @@ static irqreturn_t flexcan_irq(int irq, void *dev_id)
577 580
578 reg_iflag1 = flexcan_read(&regs->iflag1); 581 reg_iflag1 = flexcan_read(&regs->iflag1);
579 reg_esr = flexcan_read(&regs->esr); 582 reg_esr = flexcan_read(&regs->esr);
580 flexcan_write(FLEXCAN_ESR_ERR_INT, &regs->esr); /* ACK err IRQ */ 583 /* ACK all bus error and state change IRQ sources */
584 if (reg_esr & FLEXCAN_ESR_ALL_INT)
585 flexcan_write(reg_esr & FLEXCAN_ESR_ALL_INT, &regs->esr);
581 586
582 /* 587 /*
583 * schedule NAPI in case of: 588 * schedule NAPI in case of: