* [PATCH] drm/amdgpu/pm: Remove gpu_od if it's an empty directory
@ 2024-04-17 5:53 Ma Jun
2024-04-17 6:06 ` Wang, Yang(Kevin)
2024-04-17 11:52 ` Lazar, Lijo
0 siblings, 2 replies; 4+ messages in thread
From: Ma Jun @ 2024-04-17 5:53 UTC (permalink / raw)
To: amd-gfx
Cc: Kenneth.Feng, Alexander.Deucher, kevinyang.wang, lijo.lazar, Ma Jun
gpu_od should be removed if it's an empty directory
Signed-off-by: Ma Jun <Jun.Ma2@amd.com>
Reported-by: Yang Wang <kevinyang.wang@amd.com>
---
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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* RE: [PATCH] drm/amdgpu/pm: Remove gpu_od if it's an empty directory
2024-04-17 5:53 [PATCH] drm/amdgpu/pm: Remove gpu_od if it's an empty directory Ma Jun
@ 2024-04-17 6:06 ` Wang, Yang(Kevin)
2024-04-17 11:52 ` Lazar, Lijo
1 sibling, 0 replies; 4+ messages in thread
From: Wang, Yang(Kevin) @ 2024-04-17 6:06 UTC (permalink / raw)
To: Ma, Jun, amd-gfx; +Cc: Feng, Kenneth, Deucher, Alexander, Lazar, Lijo
Reviewed-by: Yang Wang <kevinyang.wang@amd.com>
Best Regards,
Kevin
-----Original Message-----
From: Ma, Jun <Jun.Ma2@amd.com>
Sent: 2024年4月17日 13:54
To: amd-gfx@lists.freedesktop.org
Cc: Feng, Kenneth <Kenneth.Feng@amd.com>; Deucher, Alexander <Alexander.Deucher@amd.com>; Wang, Yang(Kevin) <KevinYang.Wang@amd.com>; Lazar, Lijo <Lijo.Lazar@amd.com>; Ma, Jun <Jun.Ma2@amd.com>
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@amd.com>
Reported-by: Yang Wang <kevinyang.wang@amd.com>
---
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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/amdgpu/pm: Remove gpu_od if it's an empty directory
2024-04-17 5:53 [PATCH] drm/amdgpu/pm: Remove gpu_od if it's an empty directory Ma Jun
2024-04-17 6:06 ` Wang, Yang(Kevin)
@ 2024-04-17 11:52 ` Lazar, Lijo
2024-04-18 1:21 ` Ma, Jun
1 sibling, 1 reply; 4+ messages in thread
From: Lazar, Lijo @ 2024-04-17 11:52 UTC (permalink / raw)
To: Ma Jun, amd-gfx; +Cc: Kenneth.Feng, Alexander.Deucher, kevinyang.wang
On 4/17/2024 11:23 AM, Ma Jun wrote:
> gpu_od should be removed if it's an empty directory
>
> Signed-off-by: Ma Jun <Jun.Ma2@amd.com>
> Reported-by: Yang Wang <kevinyang.wang@amd.com>
> ---
> 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))
Instead of assuming any order, what about using "list_is_singular" - if
this is the only entry in the list?
Thanks,
Lijo
> + goto err_out;
> +
> return 0;
>
> err_out:
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/amdgpu/pm: Remove gpu_od if it's an empty directory
2024-04-17 11:52 ` Lazar, Lijo
@ 2024-04-18 1:21 ` Ma, Jun
0 siblings, 0 replies; 4+ messages in thread
From: Ma, Jun @ 2024-04-18 1:21 UTC (permalink / raw)
To: Lazar, Lijo, Ma Jun, amd-gfx
Cc: majun, Kenneth.Feng, Alexander.Deucher, kevinyang.wang
On 4/17/2024 7:52 PM, Lazar, Lijo wrote:
>
>
> On 4/17/2024 11:23 AM, Ma Jun wrote:
>> gpu_od should be removed if it's an empty directory
>>
>> Signed-off-by: Ma Jun <Jun.Ma2@amd.com>
>> Reported-by: Yang Wang <kevinyang.wang@amd.com>
>> ---
>> 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))
>
> 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
> Thanks,
> Lijo
>> + goto err_out;
>> +
>> return 0;
>>
>> err_out:
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-04-18 1:21 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-17 5:53 [PATCH] drm/amdgpu/pm: Remove gpu_od if it's an empty directory Ma Jun
2024-04-17 6:06 ` Wang, Yang(Kevin)
2024-04-17 11:52 ` Lazar, Lijo
2024-04-18 1:21 ` Ma, Jun
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.