amdgcn: remove unnecessary scalar cache flush

Message ID 6d9dea6e-5595-477e-b049-6992623f13fc@codesourcery.com
State New
Headers
Series amdgcn: remove unnecessary scalar cache flush |

Commit Message

Andrew Stubbs Oct. 20, 2023, 11:54 a.m. UTC
  Hi,

This patch is necessary to support AMD RDNA2 GPUs that don't have a 
writable scalar cache.  However, the write back isn't actually doing 
anything useful on any GPU any more, so we can remove it.

Andrew
amdgcn: remove unnecessary scalar cache flush

The exit code isn't actually written via the scalar cache so the cache flush
is not actually needed.
  

Comments

Andrew Stubbs Oct. 31, 2023, 11:26 a.m. UTC | #1
Ping.

On 20/10/2023 12:54, Andrew Stubbs wrote:
> Hi,
> 
> This patch is necessary to support AMD RDNA2 GPUs that don't have a 
> writable scalar cache.  However, the write back isn't actually doing 
> anything useful on any GPU any more, so we can remove it.
> 
> Andrew
  
Corinna Vinschen Oct. 31, 2023, 12:39 p.m. UTC | #2
On Oct 20 12:54, Andrew Stubbs wrote:
> Hi,
> 
> This patch is necessary to support AMD RDNA2 GPUs that don't have a writable
> scalar cache.  However, the write back isn't actually doing anything useful
> on any GPU any more, so we can remove it.
> 
> Andrew

> amdgcn: remove unnecessary scalar cache flush
> 
> The exit code isn't actually written via the scalar cache so the cache flush
> is not actually needed.
> 
> diff --git a/newlib/libc/machine/amdgcn/exit-value.h b/newlib/libc/machine/amdgcn/exit-value.h
> index 7aa2508bb..6b9d2411b 100644
> --- a/newlib/libc/machine/amdgcn/exit-value.h
> +++ b/newlib/libc/machine/amdgcn/exit-value.h
> @@ -32,7 +32,6 @@ exit_with_int (int val)
>    *return_value = val;
>  
>    /* Terminate the current kernel.  */
> -  asm ("s_dcache_wb");
>    asm ("s_endpgm");
>    __builtin_unreachable ();
>  }

Pushed.

Thanks,
Corinna
  

Patch

diff --git a/newlib/libc/machine/amdgcn/exit-value.h b/newlib/libc/machine/amdgcn/exit-value.h
index 7aa2508bb..6b9d2411b 100644
--- a/newlib/libc/machine/amdgcn/exit-value.h
+++ b/newlib/libc/machine/amdgcn/exit-value.h
@@ -32,7 +32,6 @@  exit_with_int (int val)
   *return_value = val;
 
   /* Terminate the current kernel.  */
-  asm ("s_dcache_wb");
   asm ("s_endpgm");
   __builtin_unreachable ();
 }