[PATCH 6.8 176/228] drm/amdgpu/pm: Remove gpu_od if its an empty directory

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

 



6.8-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Ma Jun <Jun.Ma2@xxxxxxx>

commit 0e95ed6452cb079cf9587c774a475a7d83c7e040 upstream.

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>
Reviewed-by: Yang Wang <kevinyang.wang@xxxxxxx>
Suggested-by: Lijo Lazar <lijo.lazar@xxxxxxx>
Signed-off-by: Alex Deucher <alexander.deucher@xxxxxxx>
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 drivers/gpu/drm/amd/pm/amdgpu_pm.c |    7 +++++++
 1 file changed, 7 insertions(+)

--- a/drivers/gpu/drm/amd/pm/amdgpu_pm.c
+++ b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
@@ -4217,6 +4217,13 @@ static int amdgpu_od_set_init(struct amd
 		}
 	}
 
+	/*
+	 * 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))
+		goto err_out;
+
 	return 0;
 
 err_out:






[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux