[PATCH] drm/xe: Check result of drmm_mutex_init()

Ghimiray, Himal Prasad himal.prasad.ghimiray at intel.com
Wed Apr 10 04:28:45 UTC 2024


On 09-04-2024 23:31, Lucas De Marchi wrote:
> On Tue, Apr 09, 2024 at 05:31:32PM +0200, Michal Wajdeczko wrote:
>> Although it's unlikely that drmm_mutex_init() will fail during
>> driver initialization, however we shouldn't ignore this case.
>>
>> Signed-off-by: Michal Wajdeczko <michal.wajdeczko at intel.com>
>
> there was already a patch pending for this, but got stuck because it was
> trying to do something similar for all the display mutexes, that
> shouldn't be there in the first place. Not sure if we take that one with
> conflict resolved or this.



If the patch mentioned is 
https://patchwork.freedesktop.org/series/131300/, it does not resolve 
the mutex mentioned above.

>
>> ---
>> drivers/gpu/drm/xe/xe_device.c | 4 +++-
>> 1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/xe/xe_device.c 
>> b/drivers/gpu/drm/xe/xe_device.c
>> index 9083f5e02dd9..ba3643906d9e 100644
>> --- a/drivers/gpu/drm/xe/xe_device.c
>> +++ b/drivers/gpu/drm/xe/xe_device.c
>> @@ -273,7 +273,9 @@ struct xe_device *xe_device_create(struct pci_dev 
>> *pdev,
>>
>>     init_waitqueue_head(&xe->ufence_wq);
>>
>> -    drmm_mutex_init(&xe->drm, &xe->usm.lock);
>> +    err = drmm_mutex_init(&xe->drm, &xe->usm.lock);
>> +    if (err)
>> +        goto err;
>
> blank line missing
>
> Lucas De Marchi
>
>>     xa_init_flags(&xe->usm.asid_to_vm, XA_FLAGS_ALLOC);
>>
>>     if (IS_ENABLED(CONFIG_DRM_XE_DEBUG)) {
>> -- 
>> 2.43.0
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/intel-xe/attachments/20240410/cdc8be39/attachment.htm>


More information about the Intel-xe mailing list