[AMD Official Use Only - AMD Internal Distribution Only]
Hi SRINIVASAN,
Please pause this patch.
The original intention of the patch was to avoid creating an empty directory
("gpu_od") , as this change may result in incorrect results.
Thanks.
Best Regards,
Kevin
-----Original Message-----
From: SHANMUGAM, SRINIVASAN <[email protected]>
Sent: Tuesday, May 28, 2024 2:53 PM
To: Koenig, Christian <[email protected]>; Deucher, Alexander
<[email protected]>
Cc: [email protected]; SHANMUGAM, SRINIVASAN
<[email protected]>; Ma, Jun <[email protected]>; Wang, Yang(Kevin)
<[email protected]>; Lazar, Lijo <[email protected]>
Subject: [PATCH] drm/amdgpu: Fix missing error code in amdgpu_od_set_init
This commit ensures that an error code -EINVAL is set in the amdgpu_od_set_init
function when the od_kobj_list has only one entry, indicating that the list is
not in the expected state.
Fixes the below:
drivers/gpu/drm/amd/amdgpu/../pm/amdgpu_pm.c:4355 amdgpu_od_set_init() warn:
missing error code 'ret'
Fixes: d9a3a5e770dc ("drm/amdgpu/pm: Remove gpu_od if it's an empty directory")
Cc: Ma Jun <[email protected]>
Cc: Yang Wang <[email protected]>
Cc: Lijo Lazar <[email protected]>
Cc: Alex Deucher <[email protected]>
Cc: Christian König <[email protected]>
Signed-off-by: Srinivasan Shanmugam <[email protected]>
---
drivers/gpu/drm/amd/pm/amdgpu_pm.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/pm/amdgpu_pm.c
b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
index d5d6ab484e5a..86118fbfc33c 100644
--- a/drivers/gpu/drm/amd/pm/amdgpu_pm.c
+++ b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
@@ -4463,8 +4463,10 @@ static int amdgpu_od_set_init(struct amdgpu_device *adev)
* If gpu_od is the only member in the list, that means gpu_od is an
* empty directory, so remove it.
*/
- if (list_is_singular(&adev->pm.od_kobj_list))
+ if (list_is_singular(&adev->pm.od_kobj_list)) {
+ ret = -EINVAL;
goto err_out;
+ }
return 0;
--
2.34.1