Skip to content

Commit 9eec61d

Browse files
bijudasKAGA-KOKO
authored andcommitted
irqchip/renesas-rzg2l: Flush posted write in irq_eoi()
The irq_eoi() callback of the RZ/G2L interrupt chip clears the relevant interrupt cause bit in the TSCR register by writing to it. This write is not sufficient because the write is posted and therefore not guaranteed to immediately clear the bit. Due to that delay the CPU can raise the just handled interrupt again. Prevent this by reading the register back which causes the posted write to be flushed to the hardware before the read completes. Fixes: 3fed095 ("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>
1 parent ca5b0b7 commit 9eec61d

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

drivers/irqchip/irq-renesas-rzg2l.c

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,14 @@ static void rzg2l_irq_eoi(struct irq_data *d)
9999
* ISCR can only be cleared if the type is falling-edge, rising-edge or
100100
* falling/rising-edge.
101101
*/
102-
if ((iscr & bit) && (iitsr & IITSR_IITSEL_MASK(hw_irq)))
102+
if ((iscr & bit) && (iitsr & IITSR_IITSEL_MASK(hw_irq))) {
103103
writel_relaxed(iscr & ~bit, priv->base + ISCR);
104+
/*
105+
* Enforce that the posted write is flushed to prevent that the
106+
* just handled interrupt is raised again.
107+
*/
108+
readl_relaxed(priv->base + ISCR);
109+
}
104110
}
105111

106112
static void rzg2l_tint_eoi(struct irq_data *d)
@@ -111,8 +117,14 @@ static void rzg2l_tint_eoi(struct irq_data *d)
111117
u32 reg;
112118

113119
reg = readl_relaxed(priv->base + TSCR);
114-
if (reg & bit)
120+
if (reg & bit) {
115121
writel_relaxed(reg & ~bit, priv->base + TSCR);
122+
/*
123+
* Enforce that the posted write is flushed to prevent that the
124+
* just handled interrupt is raised again.
125+
*/
126+
readl_relaxed(priv->base + TSCR);
127+
}
116128
}
117129

118130
static void rzg2l_irqc_eoi(struct irq_data *d)

0 commit comments

Comments
 (0)