Re: [PATCH] powerpc/ps3: Use cpu_relax() in ps3_create_spu()

Geert Uytterhoeven <[email protected]>
Newsgroups org.ozlabs.lists.linuxppc-dev,org.kernel.vger.linux-kernel
Message-ID <CAMuHMdVBjAs_67YdD0mqoBO2yYM2UFZ0=AY4KHJBrz-MmF1txw@mail.gmail.com>
Hi Thorsten,

On Tue, 21 Jul 2026 at 01:12, Thorsten Blum <[email protected]> wrote:
> Use cpu_relax() to wait for the execution status SPE_EX_STATE_EXECUTED.
> Drop the comments while at it.
>
> Signed-off-by: Thorsten Blum <[email protected]>

Thanks for your patch!

> --- a/arch/powerpc/platforms/ps3/spu.c
> +++ b/arch/powerpc/platforms/ps3/spu.c
> @@ -13,6 +13,7 @@
>  #include <linux/export.h>
>  #include <linux/io.h>
>  #include <linux/mm.h>
> +#include <linux/processor.h>
>
>  #include <asm/spu.h>
>  #include <asm/spu_priv1.h>
> @@ -363,12 +364,9 @@ static int __init ps3_create_spu(struct spu *spu, void *data)
>         if (result)
>                 goto fail_enable;
>
> -       /* Make sure the spu is in SPE_EX_STATE_EXECUTED. */
> -
> -       /* need something better here!!! */
> -       while (in_be64(&spu_pdata(spu)->shadow->spe_execution_status)
> -               != SPE_EX_STATE_EXECUTED)
> -               (void)0;
> +       while (in_be64(&spu_pdata(spu)->shadow->spe_execution_status) !=
> +              SPE_EX_STATE_EXECUTED)
> +               cpu_relax();

I think we still need something better here, like proper timeout
handling using read_poll_timeout()?

>
>         return result;

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.