[Intel-xe] [PATCH 2/3] drm/xe: Use spinlock in forcewake instead of mutex

Dixit, Ashutosh ashutosh.dixit at intel.com
Wed Aug 30 05:33:02 UTC 2023


On Tue, 29 Aug 2023 22:15:43 -0700, Aravind Iddamsetty wrote:
>

Hi Aravind,

> @@ -162,7 +162,7 @@ int xe_force_wake_get(struct xe_force_wake *fw,
>				   domain->id, ret);
>	}
>	fw->awake_domains |= woken;
> -	mutex_unlock(&fw->lock);
> +	spin_unlock(&fw->lock);

No need to change anything yet, but let's get some more opinion on this: is
it ok to (a) just replace the mutex with a spinlock in these force_wake
functions, or, (b) should we have a second set of functions to be called in
atomic context, say: xe_force_wake_get/put_atomic? So we should use (b) in
atomic contexts and everywhere else we just continue to use the previous
set of non-atomic functions? Or just converting the default set of
functions to use spin lock (as is done in this patch) is ok?

Thanks.
--
Ashutosh


More information about the Intel-xe mailing list