drm/amdgpu/pm: Remove gpu_od if it's an empty directory
Subsystems (3)
PATCH 1/1 drm/amdgpu/pm: Remove gpu_od if it's an empty directory
gpu_od should be removed if it's an empty directory
--- drivers/gpu/drm/amd/pm/amdgpu_pm.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/gpu/drm/amd/pm/amdgpu_pm.c +7 -0
@@ -4338,6 +4338,13 @@ static int amdgpu_od_set_init(struct amdgpu_device *adev) } } +/* +* If gpu_od is the first member in the list, that means gpu_od is an +* empty directory, so remove it. +*/ +if (list_is_first (&top_set->entry, &adev->pm.od_kobj_list)) + goto err_out; +return 0 ; err_out:
Signature · 1 line
2.34.1
Best Regards,
Kevin
-----Original Message-----
From: Ma, Jun <[email protected]>
Sent: 2024年4月17日 13:54
To: [email protected]
Cc: Feng, Kenneth <[email protected]>; Deucher, Alexander <[email protected]>; Wang, Yang(Kevin) <[email protected]>; Lazar, Lijo <[email protected]>; Ma, Jun <[email protected]>
Subject: [PATCH] drm/amdgpu/pm: Remove gpu_od if it's an empty directory
gpu_od should be removed if it's an empty directory
--- drivers/gpu/drm/amd/pm/amdgpu_pm.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/gpu/drm/amd/pm/amdgpu_pm.c +7 -0
@@ -4338,6 +4338,13 @@ static int amdgpu_od_set_init(struct amdgpu_device *adev) } } +/* +* If gpu_od is the first member in the list, that means gpu_od is an +* empty directory, so remove it. +*/ +if (list_is_first (&top_set->entry, &adev->pm.od_kobj_list)) + goto err_out; +return 0 ; err_out:
Signature · 1 line
2.34.1
Quoted 13 lines · Ma Jun
gpu_odshould be removed if it's an empty directorySigned-off-by Ma Jun <[email protected]>Reported-by Yang Wang <[email protected]>--- drivers/gpu/drm/amd/pm/amdgpu_pm.c | 7 +++++++ 1 file changed, 7 insertions(+)drivers/gpu/drm/amd/pm/amdgpu_pm.c +0
-0
drivers/gpu/drm/amd/pm/amdgpu_pm.c static int amdgpu_od_set_init(struct amdgpu_device *adev) · line 4345
Quoted 8 lines
drivers/gpu/drm/amd/pm/amdgpu_pm.c +5
-0@@ -4338,6 +4338,13 @@ static int amdgpu_od_set_init(struct amdgpu_device *adev) } } +/* +* If gpu_od is the first member in the list, that means gpu_od is an +* empty directory, so remove it. +*/ +if (list_is_first (&top_set->entry, &adev->pm.od_kobj_list))
Instead of assuming any order, what about using "list_is_singular" - if this is the only entry in the list?
Thanks,
Lijo
Quoted 5 lines
drivers/gpu/drm/amd/pm/amdgpu_pm.c +2
-0+ goto err_out; +return 0 ; err_out:
Quoted 19 lines · Lijo
Quoted 16 lines · Ma Jun
gpu_odshould be removed if it's an empty directorySigned-off-by Ma Jun <[email protected]>Reported-by Yang Wang <[email protected]>--- drivers/gpu/drm/amd/pm/amdgpu_pm.c | 7 +++++++ 1 file changed, 7 insertions(+)drivers/gpu/drm/amd/pm/amdgpu_pm.c +0
-0@@ -4338,6 +4338,13 @@ static int amdgpu_od_set_init(struct amdgpu_device *adev) } }
Quoted 9 lines
drivers/gpu/drm/amd/pm/amdgpu_pm.c static int amdgpu_od_set_init(struct amdgpu_device *adev) · line 4345
Quoted 5 lines
drivers/gpu/drm/amd/pm/amdgpu_pm.c +5
-0+/* +* If gpu_od is the first member in the list, that means gpu_od is an +* empty directory, so remove it. +*/ +if (list_is_first (&top_set->entry, &adev->pm.od_kobj_list))Instead of assuming any order, what about using "
list_is_singular" - if this is the only entry in the list?
Thanks, will update it when push.
Regards,
Ma Jun
Quoted 7 lines
Thanks,
LijoQuoted 5 lines
drivers/gpu/drm/amd/pm/amdgpu_pm.c +2
-0+ goto err_out; +return 0 ; err_out: