Skip to content

Commit 0df6664

Browse files
author
Marc Zyngier
committed
irqchip/gic-v3: Fix GICR_CTLR.RWP polling
It turns out that our polling of RWP is totally wrong when checking for it in the redistributors, as we test the *distributor* bit index, whereas it is a different bit number in the RDs... Oopsie boo. This is embarassing. Not only because it is wrong, but also because it took *8 years* to notice the blunder... Just fix the damn thing. Fixes: 021f653 ("irqchip: gic-v3: Initial support for GICv3") Signed-off-by: Marc Zyngier <maz@kernel.org> Cc: stable@vger.kernel.org Reviewed-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Link: https://lore.kernel.org/r/20220315165034.794482-2-maz@kernel.org
1 parent af27e41 commit 0df6664

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/irqchip/irq-gic-v3.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,11 +206,11 @@ static inline void __iomem *gic_dist_base(struct irq_data *d)
206206
}
207207
}
208208

209-
static void gic_do_wait_for_rwp(void __iomem *base)
209+
static void gic_do_wait_for_rwp(void __iomem *base, u32 bit)
210210
{
211211
u32 count = 1000000; /* 1s! */
212212

213-
while (readl_relaxed(base + GICD_CTLR) & GICD_CTLR_RWP) {
213+
while (readl_relaxed(base + GICD_CTLR) & bit) {
214214
count--;
215215
if (!count) {
216216
pr_err_ratelimited("RWP timeout, gone fishing\n");
@@ -224,13 +224,13 @@ static void gic_do_wait_for_rwp(void __iomem *base)
224224
/* Wait for completion of a distributor change */
225225
static void gic_dist_wait_for_rwp(void)
226226
{
227-
gic_do_wait_for_rwp(gic_data.dist_base);
227+
gic_do_wait_for_rwp(gic_data.dist_base, GICD_CTLR_RWP);
228228
}
229229

230230
/* Wait for completion of a redistributor change */
231231
static void gic_redist_wait_for_rwp(void)
232232
{
233-
gic_do_wait_for_rwp(gic_data_rdist_rd_base());
233+
gic_do_wait_for_rwp(gic_data_rdist_rd_base(), GICR_CTLR_RWP);
234234
}
235235

236236
#ifdef CONFIG_ARM64

0 commit comments

Comments
 (0)