[PATCH] drm/xe/client: bo->client does not need bos_lock

Ghimiray, Himal Prasad himal.prasad.ghimiray at intel.com
Fri Feb 7 05:44:27 UTC 2025



On 05-02-2025 10:40, Tejas Upadhyay wrote:
> bos_lock is to protect list of bos used by client, it is
> not required to protect bo->client so bring it outside of
> bos_lock.
> 
> Fixes: b27970f3e11c ("drm/xe: Add tracking support for bos per client")
> Signed-off-by: Tejas Upadhyay <tejas.upadhyay at intel.com>
> ---
>   drivers/gpu/drm/xe/xe_drm_client.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_drm_client.c b/drivers/gpu/drm/xe/xe_drm_client.c
> index 63f30b6df70b..2d4874d2b922 100644
> --- a/drivers/gpu/drm/xe/xe_drm_client.c
> +++ b/drivers/gpu/drm/xe/xe_drm_client.c
> @@ -135,8 +135,8 @@ void xe_drm_client_add_bo(struct xe_drm_client *client,
>   	XE_WARN_ON(bo->client);
>   	XE_WARN_ON(!list_empty(&bo->client_link));
>   
> -	spin_lock(&client->bos_lock);
>   	bo->client = xe_drm_client_get(client);
> +	spin_lock(&client->bos_lock);


LGTM.
Reviewed-by: Himal Prasad Ghimiray <himal.prasad.ghimiray at intel.com>


>   	list_add_tail(&bo->client_link, &client->bos_list);
>   	spin_unlock(&client->bos_lock);
>   }



More information about the Intel-xe mailing list