FAILED: patch "[PATCH] can: rcar_canfd: rcar_canfd_handle_global_receive(): fix IRQ" failed to apply to 4.9-stable tree
Subsystems (3)
[email protected]
maintainerThe patch below does not apply to the 4.9-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
Possible dependencies:
702de2c21eed ("can: rcar_canfd: rcar_canfd_handle_global_receive(): fix IRQ storm on global FIFO receive") 45721c406dcf ("can: rcar_canfd: Add support for r8a779a0 SoC")76e9353a80e9 ("can: rcar_canfd: Add support for RZ/G2L family")13dfb3fa4943 ("Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 702de2c21eed04c67cefaaedc248ef16e5f6b293 Mon Sep 17 00:00:00 2001
From: Biju Das <[email protected]>
Date: Tue, 25 Oct 2022 16:56:55 +0100
Subject: [PATCH] can: rcar_canfd: rcar_canfd_handle_global_receive(): fix IRQ
storm on global FIFO receive
We are seeing an IRQ storm on the global receive IRQ line under heavy CAN bus load conditions with both CAN channels enabled.
Conditions:
The global receive IRQ line is shared between can0 and can1, either of the channels can trigger interrupt while the other channel's IRQ line is disabled (RFIE).
When global a receive IRQ interrupt occurs, we mask the interrupt in the IRQ handler. Clearing and unmasking of the interrupt is happening in rx_poll(). There is a race condition where rx_poll() unmasks the interrupt, but the next IRQ handler does not mask the IRQ due to NAPIF_STATE_MISSED flag (e.g.: can0 RX FIFO interrupt is disabled and can1 is triggering RX interrupt, the delay in rx_poll() processing results in setting NAPIF_STATE_MISSED flag) leading to an IRQ storm.
This patch fixes the issue by checking IRQ active and enabled before handling the IRQ on a particular channel.
drivers/net/can/rcar/rcar_canfd.c +4 -2
@@ -1157,11 +1157,13 @@ static void rcar_canfd_handle_global_receive(struct rcar_canfd_global *gpriv, u3 {struct rcar_canfd_channel *priv = gpriv->ch[ch];u32 ridx = ch +RCANFD_RFFIFO_IDX ; -u32 sts; +u32 sts, cc;/* Handle Rx interrupts */ sts =rcar_canfd_read (priv->base,RCANFD_RFSTS (gpriv, ridx)); -if (likely (sts &RCANFD_RFSTS_RFIF )) { + cc =rcar_canfd_read (priv->base,RCANFD_RFCC (gpriv, ridx)); +if (likely (sts &RCANFD_RFSTS_RFIF && + cc &RCANFD_RFCC_RFIE )) {if (napi_schedule_prep (&priv->napi)) {/* Disable Rx FIFO interrupts */ rcar_canfd_clear_bit(priv->base,
Hi All,
I will send patch to 4.9 stable after fixing the conflicts. Similar for other failed patches.
Cheers,
Biju
Quoted 82 lines
Subject: FAILED: patch "[PATCH] can:
rcar_canfd:rcar_canfd_handle_global_receive(): fix IRQ" failed to apply to 4.9- stable treeThe patch below does not apply to the 4.9-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.Possible dependencies:
702de2c21eed("can:rcar_canfd:rcar_canfd_handle_global_receive():
fix IRQ storm on global FIFO receive")45721c406dcf("can:rcar_canfd:
Add support for r8a779a0 SoC")76e9353a80e9("can:rcar_canfd: Add support for RZ/G2L family")13dfb3fa4943("Mergegit://git.kernel.org/pub/scm/linux/kernel/git/netdev/net")thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From
702de2c21eed04c67cefaaedc248ef16e5f6b293Mon Sep 17 00:00:00 2001
From: Biju Das <[email protected]>
Date: Tue, 25 Oct 2022 16:56:55 +0100
Subject: [PATCH] can:rcar_canfd:rcar_canfd_handle_global_receive():
fix IRQ storm on global FIFO receiveWe are seeing an IRQ storm on the global receive IRQ line under heavy CAN bus load conditions with both CAN channels enabled.
Conditions:
The global receive IRQ line is shared between can0 and can1, either of the channels can trigger interrupt while the other channel's IRQ line is disabled (RFIE).
When global a receive IRQ interrupt occurs, we mask the interrupt in the IRQ handler. Clearing and unmasking of the interrupt is happening in
rx_poll(). There is a race condition whererx_poll()unmasks the interrupt, but the next IRQ handler does not mask the IRQ due toNAPIF_STATE_MISSEDflag (e.g.: can0 RX FIFO interrupt is disabled and can1 is triggering RX interrupt, the delay inrx_poll()processing results in settingNAPIF_STATE_MISSEDflag) leading to an IRQ storm.This patch fixes the issue by checking IRQ active and enabled before handling the IRQ on a particular channel.
Fixes dd3bd23eb438 ("can: rcar_canfd: Add Renesas R-Car CAN FDdriver")
Suggested-by Marc Kleine-Budde <[email protected]>Signed-off-by Biju Das <[email protected]>Link:
drivers/net/can/rcar/rcar_canfd.c +0
-0@@ -1157,11 +1157,13 @@ static voidrcar_canfd_handle_global_receive(struct
rcar_canfd_global*gpriv, u3 {drivers/net/can/rcar/rcar_canfd.c +4
-2struct rcar_canfd_channel *priv = gpriv->ch[ch];u32 ridx = ch +RCANFD_RFFIFO_IDX ; -u32 sts; +u32 sts, cc;/* Handle Rx interrupts */ sts =rcar_canfd_read (priv->base,RCANFD_RFSTS (gpriv, ridx)); -if (likely (sts &RCANFD_RFSTS_RFIF )) { + cc =rcar_canfd_read (priv->base,RCANFD_RFCC (gpriv, ridx)); +if (likely (sts &RCANFD_RFSTS_RFIF && + cc &RCANFD_RFCC_RFIE )) {if (napi_schedule_prep (&priv->napi)) {/* Disable Rx FIFO interrupts */ rcar_canfd_clear_bit(priv->base,