Re: [PATCH 1/3] clk: ingenic: Poll JZ4780 CPU1 power status atomically

From: Paul Cercueil

Date: Fri Nov 06 2026 - 04:12:26 EST


Hi Florian,

Le jeudi 05 novembre 2026 à 12:32 -0800, Florian Fainelli a écrit :
> The CPU1 clock enable callback runs under the clock framework's spinlock
> with interrupts disabled. Its readl_poll_timeout() can sleep between
> reads, which is invalid in this context when SMP powers up CPU1.
>
> Use readl_poll_timeout_atomic() with the existing interval and timeout.
> This is a prerequisite for the JZ4780 SMP bring-up path. The original
> CPU1 clock implementation by Zhou Yanjie is already upstream.
>
> Cross-built for CI20; the subsequent SMP-enabled image brought up both
> CPU cores. Development and validation used Codex assistance.
>
> Fixes: 6673db4f3f26 ("clk: JZ4780: Add function for enable the second core.")
> Link:
> https://lkml.kernel.org/r/1582215889-113034-3-git-send-email-zhouyanjie@xxxxxxxxxxxxxx
> Signed-off-by: Florian Fainelli <f.fainelli@xxxxxxxxx>

Reviewed-by: Paul Cercueil <paul@xxxxxxxxxxxxxxx>

Cheers,
-Paul

> ---
>  drivers/clk/ingenic/jz4780-cgu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/clk/ingenic/jz4780-cgu.c b/drivers/clk/ingenic/jz4780-
> cgu.c
> index 1e88aef7ac0f..f5983033583a 100644
> --- a/drivers/clk/ingenic/jz4780-cgu.c
> +++ b/drivers/clk/ingenic/jz4780-cgu.c
> @@ -242,7 +242,7 @@ static int jz4780_core1_enable(struct clk_hw *hw)
>   spin_unlock_irqrestore(&cgu->lock, flags);
>  
>   /* wait for the CPU to be powered up */
> - retval = readl_poll_timeout(cgu->base + CGU_REG_LCR, lcr,
> + retval = readl_poll_timeout_atomic(cgu->base + CGU_REG_LCR, lcr,
>   !(lcr & LCR_SCPUS), 10, timeout);
>   if (retval == -ETIMEDOUT) {
>   pr_err("%s: Wait for power up core1 timeout\n", __func__);