[PATCH] drm/amdgpu: fix a warning in amdgpu_ras.c

Luben Tuikov luben.tuikov at amd.com
Fri Sep 25 17:36:01 UTC 2020


On 2020-09-25 11:00, Nirmoy wrote:
> Acked-by: Nirmoy Das <nirmoy.das at amd.com>
> 
> On 9/25/20 4:31 PM, Alex Deucher wrote:
>> drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c: In function ‘amdgpu_ras_fs_init’:
>> drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c:1284:2: warning: ignoring return value of ‘sysfs_create_group’, declared with attribute warn_unused_result [-Wunused-result]
>>   1284 |  sysfs_create_group(&adev->dev->kobj, &group);
>>        |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>
>> Signed-off-by: Alex Deucher <alexander.deucher at amd.com>
>> ---
>>
>> Do we care whether this fails or not?
> 
> 
> I think we should. Failure in sysfs_create_group() means memory starved
> 
> system or we are doing something in the driver code.
> 
> IMO in both cases, we should error out.

I disagree. We should try to bring up a display as much as possible.
sysfs failing shouldn't necessarily bring down the system.
The system should be as resilient as possible and try to survive
as much as possible.

If indeed we had had a memory starvation, other things would fail,
before or after this sequence. And if those things are terminal,
which sysfs is not, then let those other errors, such as no memory
for BOs, bring the display bring-up down.

Regards,
Luben


> 
> 
> Nirmoy
> 
>>
>>   drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 4 +---
>>   1 file changed, 1 insertion(+), 3 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
>> index 49d10330bf64..67724049a0fc 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
>> @@ -1281,9 +1281,7 @@ static int amdgpu_ras_fs_init(struct amdgpu_device *adev)
>>   		sysfs_bin_attr_init(bin_attrs[0]);
>>   	}
>>   
>> -	sysfs_create_group(&adev->dev->kobj, &group);
>> -
>> -	return 0;
>> +	return sysfs_create_group(&adev->dev->kobj, &group);
>>   }
>>   
>>   static int amdgpu_ras_fs_fini(struct amdgpu_device *adev)
> _______________________________________________
> amd-gfx mailing list
> amd-gfx at lists.freedesktop.org
> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=02%7C01%7Cluben.tuikov%40amd.com%7Cd3a29eb3223b4b58ff6b08d86163c8a9%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637366428560245712&sdata=bYWjk2k8IeEolG2wcJLA7J%2Bx2d%2FOSXNIOpLObk%2F3jSQ%3D&reserved=0
> 



More information about the amd-gfx mailing list