Star64_linux/drivers/net/can
Biju Das f4efec2a3d can: rcar_canfd: rcar_canfd_handle_global_receive(): fix IRQ storm on global FIFO receive
commit 702de2c21e upstream.

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.

Fixes: dd3bd23eb4 ("can: rcar_canfd: Add Renesas R-Car CAN FD driver")
Suggested-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Link: https://lore.kernel.org/all/20221025155657.1426948-2-biju.das.jz@bp.renesas.com
Cc: stable@vger.kernel.org
[mkl: adjust commit message]
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
[biju: removed gpriv from RCANFD_RFCC_RFIE macro]
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-04-19 17:55:54 +08:00
..
c_can can: c_can: don't cache TX messages for C_CAN cores 2023-04-19 17:54:09 +08:00
cc770
dev can: netlink: allow configuring of fixed data bit rates without need for do_set_data_bittiming callback 2023-04-19 17:52:18 +08:00
ifi_canfd
m_can
mscan can: mscan: mpc5xxx: mpc5xxx_can_probe(): add missing put_clock() in error path 2023-04-19 17:55:51 +08:00
peak_canfd
rcar can: rcar_canfd: rcar_canfd_handle_global_receive(): fix IRQ storm on global FIFO receive 2023-04-19 17:55:54 +08:00
sja1000 can: sja1000: do not report txerr and rxerr during bus-off 2023-04-19 17:52:25 +08:00
softing
spi can: mcp251x: mcp251x_can_probe(): add missing unregister_candev() in error path 2023-04-19 17:55:51 +08:00
usb can: kvaser_usb: Fix possible completions during init_completion 2023-04-19 17:55:45 +08:00
at91_can.c
flexcan.c can: flexcan: flexcan_mailbox_read() fix return value for drop = true 2023-04-19 17:54:00 +08:00
grcan.c
ipms_canfd.c
janz-ican3.c
Kconfig
kvaser_pciefd.c
led.c
Makefile
pch_can.c can: pch_can: pch_can_error(): initialize errc before using it 2023-04-19 17:52:25 +08:00
slcan.c
sun4i_can.c can: sun4i_can: do not report txerr and rxerr during bus-off 2023-04-19 17:52:25 +08:00
ti_hecc.c
vcan.c
vxcan.c
xilinx_can.c Revert "can: xilinx_can: Limit CANFD brp to 2" 2023-04-19 17:51:26 +08:00