From 4813da923159a792f506d6de4f4db2f11fb56b35 Mon Sep 17 00:00:00 2001 From: Luca Fancellu Date: Mon, 18 May 2026 08:05:24 +0100 Subject: [PATCH] xen/arm: gic-v3: Fix redistributor wakeup polling gicv3_enable_redist() clears GICR_WAKER.ProcessorSleep and then waits for GICR_WAKER.ChildrenAsleep to clear, as required after waking a redistributor. However, the polling loop currently uses "while ( timeout )". Since timeout is initially false, the loop runs only once unless the timeout path has already been reached. As a result, Xen can continue before the redistributor has completed wakeup. Use an unconditional loop, matching the surrounding timeout/break pattern, so the code polls until either ChildrenAsleep is clear or the deadline is reached. While there, also fix the timeout message. This path polls GICR_WAKER.ChildrenAsleep, not an RWP bit, so "RWP timeout" is misleading. Fixes: bc183a0235e0 ("xen/arm: Add support for GIC v3") Signed-off-by: Luca Fancellu Reviewed-by: Mykola Kvach Reviewed-by: Michal Orzel Release-Acked-by: Oleksii Kurochko (cherry picked from commit 941fdfc03e109a28ca9cfe71c111a1ef6cb9ed12) --- xen/arch/arm/gic-v3.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/arch/arm/gic-v3.c b/xen/arch/arm/gic-v3.c index 69112a831f..843824acae 100644 --- a/xen/arch/arm/gic-v3.c +++ b/xen/arch/arm/gic-v3.c @@ -704,11 +704,11 @@ static int gicv3_enable_redist(void) } cpu_relax(); udelay(1); - } while ( timeout ); + } while ( 1 ); if ( timeout ) { - dprintk(XENLOG_ERR, "GICv3: Redist enable RWP timeout\n"); + dprintk(XENLOG_ERR, "GICv3: Redist wakeup timeout\n"); return 1; }