can: flexcan: Ack wakeup interrupt separately
authorJoakim Zhang <qiangqing.zhang@nxp.com>
Wed, 4 Dec 2019 11:36:08 +0000 (11:36 +0000)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Tue, 22 Sep 2020 14:49:07 +0000 (16:49 +0200)
As FLEXCAN_ESR_ALL_INT is for all bus errors and state change IRQ
sources, strictly speaking FLEXCAN_ESR_WAK_INT does not belong to these.
So add wakeup interrupt ack separately to existing ack of the
interrupts.

Suggested-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
Link: https://lore.kernel.org/r/20191204113249.3381-3-qiangqing.zhang@nxp.com
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/flexcan.c

index b180dd1ba763a1c9ee8233a5f04a1bd32710de5b..06cddc468739e8888f3f3f90bf3b3be86a1b6103 100644 (file)
        (FLEXCAN_ESR_ERR_BUS | FLEXCAN_ESR_ERR_STATE)
 #define FLEXCAN_ESR_ALL_INT \
        (FLEXCAN_ESR_TWRN_INT | FLEXCAN_ESR_RWRN_INT | \
-        FLEXCAN_ESR_BOFF_INT | FLEXCAN_ESR_ERR_INT | \
-        FLEXCAN_ESR_WAK_INT)
+        FLEXCAN_ESR_BOFF_INT | FLEXCAN_ESR_ERR_INT)
 
 /* FLEXCAN interrupt flag register (IFLAG) bits */
 /* Errata ERR005829 step7: Reserve first valid MB */
@@ -979,10 +978,10 @@ static irqreturn_t flexcan_irq(int irq, void *dev_id)
 
        reg_esr = priv->read(&regs->esr);
 
-       /* ACK all bus error and state change IRQ sources */
-       if (reg_esr & FLEXCAN_ESR_ALL_INT) {
+       /* ACK all bus error, state change and wake IRQ sources */
+       if (reg_esr & (FLEXCAN_ESR_ALL_INT | FLEXCAN_ESR_WAK_INT)) {
                handled = IRQ_HANDLED;
-               priv->write(reg_esr & FLEXCAN_ESR_ALL_INT, &regs->esr);
+               priv->write(reg_esr & (FLEXCAN_ESR_ALL_INT | FLEXCAN_ESR_WAK_INT), &regs->esr);
        }
 
        /* state change interrupt or broken error state quirk fix is enabled */