[PATCH i-g-t 3/3] lib/xe_spin: Fix ending the loop

Cavitt, Jonathan jonathan.cavitt at intel.com
Wed Jul 31 21:39:30 UTC 2024


-----Original Message-----
From: igt-dev <igt-dev-bounces at lists.freedesktop.org> On Behalf Of Lucas De Marchi
Sent: Tuesday, July 30, 2024 8:35 PM
To: igt-dev at lists.freedesktop.org
Cc: Nerlige Ramappa, Umesh <umesh.nerlige.ramappa at intel.com>; Brost, Matthew <matthew.brost at intel.com>; De Marchi, Lucas <lucas.demarchi at intel.com>
Subject: [PATCH i-g-t 3/3] lib/xe_spin: Fix ending the loop
> 
> Less likely to be a problem with optimizations than the started
> condition, but let's stay on the safe side. Comparing to igt_spin_end(),
> that one uses a sync_write() to force a MI_BATCH_BUFFER_END in the
> beginning of the loop that has a even stronger guarantee.

s/a even/an even

My question from the prior patch applies here as well and is still non-blocking.

Otherwise:
Reviewed-by: Jonathan Cavitt <jonathan.cavitt at intel.com>
-Jonathan Cavitt

> 
> Signed-off-by: Lucas De Marchi <lucas.demarchi at intel.com>
> ---
>  lib/xe/xe_spin.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/xe/xe_spin.c b/lib/xe/xe_spin.c
> index 43a7a43c2..f8b225125 100644
> --- a/lib/xe/xe_spin.c
> +++ b/lib/xe/xe_spin.c
> @@ -183,7 +183,7 @@ void xe_spin_wait_started(struct xe_spin *spin)
>  
>  void xe_spin_end(struct xe_spin *spin)
>  {
> -	spin->end = 0;
> +	WRITE_ONCE(spin->end, 0);
>  }
>  
>  /**
> -- 
> 2.43.0
> 
> 


More information about the igt-dev mailing list