Re: [PATCH 1/3] can: rcar_canfd: Fix IRQ storm on global fifo receive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 24.10.2022 17:37:35, Marc Kleine-Budde wrote:
> On 22.10.2022 09:15:01, Biju Das wrote:
> > We are seeing IRQ storm on global receive IRQ line under heavy CAN
> > bus load conditions with both CAN channels are enabled.
> > 
> > Conditions:
> >   The global receive IRQ line is shared between can0 and can1, either
> >   of the channels can trigger interrupt while the other channel irq
> >   line is disabled(rfie).
> >   When global receive IRQ interrupt occurs, we mask the interrupt in
> >   irqhandler. Clearing and unmasking of the interrupt is happening in
> >   rx_poll(). There is a race condition where rx_poll unmask the
> >   interrupt, but the next irq handler does not mask the irq due to
> >   NAPIF_STATE_MISSED flag.
> 
> Why does this happen? Is it a problem that you call
> rcar_canfd_handle_global_receive() for a channel that has the IRQs
> actually disabled in hardware?

Can you check if the IRQ is active _and_ enabled before handling the IRQ
on a particular channel?

A more clearer approach would be to get rid of the global interrupt
handlers at all. If the hardware only given 1 IRQ line for more than 1
channel, the driver would register an IRQ handler for each channel (with
the shared attribute). The IRQ handler must check, if the IRQ is pending
and enabled. If not return IRQ_NONE, otherwise handle and return IRQ_HANDLED.

Marc

-- 
Pengutronix e.K.                 | Marc Kleine-Budde           |
Embedded Linux                   | https://www.pengutronix.de  |
Vertretung West/Dortmund         | Phone: +49-231-2826-924     |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Automotive Discussions]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [CAN Bus]

  Powered by Linux