[PATCH v5 1/8] can: flexcan: use dedicated IRQ handlers for multi-IRQ platforms
Vincent Mailhol
mailhol at kernel.org
Tue Jun 9 12:35:17 PDT 2026
On 09/06/2026 at 16:29, Ciprian Costea wrote:
> From: Ciprian Marian Costea <ciprianmarian.costea at oss.nxp.com>
>
> On platforms with multiple IRQ lines (S32G2, MCF5441X), all lines are
> registered to the same flexcan_irq() handler. Since these are distinct IRQ
> numbers, they can be dispatched concurrently on different CPUs. Both
> instances then read the same iflag and ESR registers unconditionally,
> leading to duplicate frame processing.
>
> Fix this by splitting the monolithic handler into focused parts:
> - flexcan_do_mb(): processes mailbox events
> - flexcan_do_state(): processes device state change events
> - flexcan_do_berr(): processes bus error events
>
> Introduce dedicated IRQ handlers for multi-IRQ platforms:
> - flexcan_irq_mb(): mailbox-only, used for mb-0, mb-1 IRQ lines
> - flexcan_irq_boff(): state-change-only, used for boff/state IRQ line
> - flexcan_irq_berr(): bus-error-only, used for berr IRQ line
>
> The combined flexcan_irq() handler is preserved for single-IRQ
> platforms with no functional change.
>
> Fixes: d9cead75b1c6 ("can: flexcan: add mcf5441x support")
> Signed-off-by: Ciprian Marian Costea <ciprianmarian.costea at oss.nxp.com>
> Reviewed-and-tested-by: Haibo Chen <haibo.chen at nxp.com>
> Tested-by: Enric Balletbo i Serra <eballetb at redhat.com>
Reviewed-by: Vincent Mailhol <mailhol at kernel.org>
Yours sincerely,
Vincent Mailhol
More information about the linux-arm-kernel
mailing list