powerpc/ps3: Use cpu_relax() in ps3_create_spu()
Subsystems (2)
PATCH 1/1 powerpc/ps3: Use cpu_relax() in ps3_create_spu()
Use cpu_relax() to wait for the execution status SPE_EX_STATE_EXECUTED. Drop the comments while at it.
--- arch/powerpc/platforms/ps3/spu.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
arch/powerpc/platforms/ps3/spu.c +4 -6
@@ -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 ();return result;
Le 21/07/2026 à 01:11, Thorsten Blum a écrit :
Quoted 4 lines
Use
cpu_relax()to wait for the execution statusSPE_EX_STATE_EXECUTED. Drop the comments while at it.Signed-off-by Thorsten Blum <[email protected]>
Quoted 32 lines
--- arch/powerpc/platforms/ps3/spu.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)arch/powerpc/platforms/ps3/spu.c +4
-6@@ -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 ();return result;
Quoted 4 lines · Thorsten Blum
Use
cpu_relax()to wait for the execution statusSPE_EX_STATE_EXECUTED. Drop the comments while at it.
Applied to powerpc/next.
[1/1] powerpc/ps3: Use cpu_relax() in ps3_create_spu()
https://git.kernel.org/powerpc/c/6050e3196d97c679ea06c035dbb3c64264c01281
cheers
Hi Thorsten,
Quoted 4 lines · Thorsten Blum
Use
cpu_relax()to wait for the execution statusSPE_EX_STATE_EXECUTED. Drop the comments while at it.Signed-off-by Thorsten Blum <[email protected]>
Thanks for your patch!
Quoted 13 lines
arch/powerpc/platforms/ps3/spu.c +1
-0@@ -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;
arch/powerpc/platforms/ps3/spu.c static int __init ps3_create_spu(struct spu *spu, void *data) · line 369
Quoted 10 lines
arch/powerpc/platforms/ps3/spu.c +3
-6-/* 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()?
arch/powerpc/platforms/ps3/spu.c static int __init ps3_create_spu(struct spu *spu, void *data) · line 371
Quoted 2 lines
arch/powerpc/platforms/ps3/spu.c +0
-0return result;
Gr{oetje,eeting}s,
Geert
Signature · 5 lines
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