RE: [PATCH] drm/amdgpu/pm: Remove gpu_od if it's an empty directory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Reviewed-by: Yang Wang <kevinyang.wang@xxxxxxx>

Best Regards,
Kevin

-----Original Message-----
From: Ma, Jun <Jun.Ma2@xxxxxxx> 
Sent: 2024年4月17日 13:54
To: amd-gfx@xxxxxxxxxxxxxxxxxxxxx
Cc: Feng, Kenneth <Kenneth.Feng@xxxxxxx>; Deucher, Alexander <Alexander.Deucher@xxxxxxx>; Wang, Yang(Kevin) <KevinYang.Wang@xxxxxxx>; Lazar, Lijo <Lijo.Lazar@xxxxxxx>; Ma, Jun <Jun.Ma2@xxxxxxx>
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

Signed-off-by: Ma Jun <Jun.Ma2@xxxxxxx>
Reported-by: Yang Wang <kevinyang.wang@xxxxxxx>
---
 drivers/gpu/drm/amd/pm/amdgpu_pm.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/gpu/drm/amd/pm/amdgpu_pm.c b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
index a20e03e69d38..0c13e5520e77 100644
--- a/drivers/gpu/drm/amd/pm/amdgpu_pm.c
+++ b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
@@ -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:
-- 
2.34.1





[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux