]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
irqchip/renesas-rzg2l: Prevent spurious interrupts when setting trigger type
authorBiju Das <biju.das.jz@bp.renesas.com>
Tue, 5 Mar 2024 18:39:21 +0000 (18:39 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Apr 2024 13:28:52 +0000 (15:28 +0200)
commit455b94f95e49b34c981a438a9b697673baf0618d
tree57314d8ab930128be64b16ef3c8d1e72c883a63c
parente9b18e99938b0a4f2a98c173333a48a7e7ac11b9
irqchip/renesas-rzg2l: Prevent spurious interrupts when setting trigger type

[ Upstream commit 853a6030303f8a8fa54929b68e5665d9b21aa405 ]

RZ/G2L interrupt chips require that the interrupt is masked before changing
the NMI, IRQ, TINT interrupt settings. Aside of that, after setting an edge
trigger type it is required to clear the interrupt status register in order
to avoid spurious interrupts.

The current implementation fails to do either of that and therefore is
prone to generate spurious interrupts when setting the trigger type.

Address this by:

  - Ensuring that the interrupt is masked at the chip level across the
    update for the TINT chip

  - Clearing the interrupt status register after updating the trigger mode
    for edge type interrupts

[ tglx: Massaged changelog and reverted the spin_lock_irqsave() change as
   the set_type() callback is always called with interrupts disabled. ]

Fixes: 3fed09559cd8 ("irqchip: Add RZ/G2L IA55 Interrupt Controller driver")
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/irqchip/irq-renesas-rzg2l.c