irqchip/renesas-rzg2l: Do not set TIEN and TINT source at the same time
authorBiju Das <biju.das.jz@bp.renesas.com>
Mon, 18 Mar 2024 08:50:40 +0000 (08:50 +0000)
committerThomas Gleixner <tglx@linutronix.de>
Mon, 18 Mar 2024 20:09:02 +0000 (21:09 +0100)
commitdce0919c83c325ac9dec5bc8838d5de6d32c01b1
treefbc0f8af60c5302400b2efa9492a6563e356613e
parent853a6030303f8a8fa54929b68e5665d9b21aa405
irqchip/renesas-rzg2l: Do not set TIEN and TINT source at the same time

As per the hardware team, TIEN and TINT source should not set at the same
time due to a possible hardware race leading to spurious IRQ.

Currently on some scenarios hardware settings for TINT detection is not in
sync with TINT source as the enable/disable overrides source setting value
leading to hardware inconsistent state. For eg: consider the case GPIOINT0
is used as TINT interrupt and configuring GPIOINT5 as edge type. During
rzg2l_irq_set_type(), TINT source for GPIOINT5 is set. On disable(),
clearing of the entire bytes of TINT source selection for GPIOINT5 is same
as GPIOINT0 with TIEN disabled. Apart from this during enable(), the
setting of GPIOINT5 with TIEN results in spurious IRQ as due to a HW race,
it is possible that IP can use the TIEN with previous source value
(GPIOINT0).

So, just update TIEN during enable/disable as TINT source is already set
during rzg2l_irq_set_type(). This will make the consistent hardware
settings for detection method tied with TINT source and allows to simplify
the code.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
drivers/irqchip/irq-renesas-rzg2l.c