On 11/20/2025 1:37 PM, Wang, Yang(Kevin) wrote:
[AMD Official Use Only - AMD Internal Distribution Only]
-----Original Message-----
From: Lazar, Lijo <[email protected]>
Sent: Thursday, November 20, 2025 15:41
To: Wang, Yang(Kevin) <[email protected]>; [email protected]
Cc: Zhang, Hawking <[email protected]>; Deucher, Alexander
<[email protected]>
Subject: Re: [PATCH] drm/amd/pm: adjust the visibility of pp_table sysfs node
On 11/20/2025 12:11 PM, Wang, Yang(Kevin) wrote:
[AMD Official Use Only - AMD Internal Distribution Only]
Ping...
Best Regards,
Kevin
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Yang Wang
Sent: Thursday, October 30, 2025 09:17
To: [email protected]
Cc: Zhang, Hawking <[email protected]>; Deucher, Alexander
<[email protected]>
Subject: [PATCH] drm/amd/pm: adjust the visibility of pp_table sysfs node
- make pp_table invisible on VF mode (only valid on BM)
- make pp_table invisible on Mi* chips (Not supported)
- make pp_table invisible if scpm feature is enabled.
Signed-off-by: Yang Wang <[email protected]>
---
drivers/gpu/drm/amd/pm/amdgpu_pm.c | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/pm/amdgpu_pm.c
b/drivers/gpu/vvvvvdrm/amd/pm/amdgpu_pm.c
index c83d69994380..3a14e0ff38ae 100644
--- a/drivers/gpu/drm/amd/pm/amdgpu_pm.c
+++ b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
@@ -2507,7 +2507,7 @@ static struct amdgpu_device_attr amdgpu_device_attrs[] = {
AMDGPU_DEVICE_ATTR_RO(pp_num_states,
ATTR_FLAG_BASIC|ATTR_FLAG_ONEVF),
AMDGPU_DEVICE_ATTR_RO(pp_cur_state,
ATTR_FLAG_BASIC|ATTR_FLAG_ONEVF),
AMDGPU_DEVICE_ATTR_RW(pp_force_state,
ATTR_FLAG_BASIC|ATTR_FLAG_ONEVF),
- AMDGPU_DEVICE_ATTR_RW(pp_table,
ATTR_FLAG_BASIC|ATTR_FLAG_ONEVF),
+ AMDGPU_DEVICE_ATTR_RW(pp_table,
ATTR_FLAG_BASIC),
AMDGPU_DEVICE_ATTR_RW(pp_dpm_sclk,
ATTR_FLAG_BASIC|ATTR_FLAG_ONEVF,
.attr_update = pp_dpm_clk_default_attr_update),
AMDGPU_DEVICE_ATTR_RW(pp_dpm_mclk,
ATTR_FLAG_BASIC|ATTR_FLAG_ONEVF,
@@ -2639,6 +2639,21 @@ static int default_attr_update(struct amdgpu_device
*adev, struct amdgpu_device_
if (amdgpu_dpm_get_apu_thermal_limit(adev, &limit) ==
-EOPNOTSUPP)
*states = ATTR_STATE_UNSUPPORTED;
+ } else if (DEVICE_ATTR_IS(pp_table)) {
+ switch (gc_ver) {
+ case IP_VERSION(9, 4, 3):
+ case IP_VERSION(9, 4, 4):
+ case IP_VERSION(9, 5, 0):
+ /* No PPTable support on Mi* chips */
+ *states = ATTR_STATE_UNSUPPORTED;
+ break;
+ default:
+ if (adev->scpm_enabled)
+ *states = ATTR_STATE_UNSUPPORTED;
+ else
+ *states = ATTR_STATE_SUPPORTED;
+ break;
+ }
What about using a dummy check with amdgpu_dpm_get_pp_table(adev, NULL)?
Thanks,
Lijo
[kevin]:
The linux amdgpu sysfs node provides both get and set capabilities. Therefore,
relying solely on the get function for speculative analysis may not be
sufficiently rigorous.
Additionally, modifications must be implemented concurrently for the backends
of both Powerplay and SWSMU.
this is purely a software logic-related adjustment and does not require
low-level operations.
This has nothing to do with sysfs. It's all about querying whether
pptable is supported or not. If it can be done with the least
maintenance that is better, otherwise need to keep adding checks with
each IP version.
Thanks,
Lijo
Best Regards,
Kevin
}
switch (gc_ver) {
--
2.34.1