drm/amd/pm: adjust the visibility of pp_table sysfs node
Subsystems (3)
PATCH 1/1 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.
--- drivers/gpu/drm/amd/pm/amdgpu_pm.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/pm/amdgpu_pm.c +16 -1
@@ -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 ; + } }switch (gc_ver) {
Signature · 1 line
2.34.1
[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.
--- drivers/gpu/drm/amd/pm/amdgpu_pm.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/pm/amdgpu_pm.c +16 -1
@@ -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 ; + } }switch (gc_ver) {
--
2.34.1
Quoted 45 lines · Yang(Kevin)
[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 ofpp_tablesysfs node- make
pp_tableinvisible on VF mode (only valid on BM)
- makepp_tableinvisible on Mi* chips (Not supported)
- makepp_tableinvisible 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(-)drivers/gpu/drm/amd/pm/amdgpu_pm.c +6
-1@@ -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 ):
drivers/gpu/drm/amd/pm/amdgpu_pm.c static int default_attr_update(struct amdgpu_device *adev, struct amdgpu_device_ · line 2656
Quoted 10 lines
drivers/gpu/drm/amd/pm/amdgpu_pm.c +10
-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
Quoted 6 lines
drivers/gpu/drm/amd/pm/amdgpu_pm.c +0
-1}switch (gc_ver) { --2.34.1
[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
Quoted 45 lines · Yang(Kevin)
[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 ofpp_tablesysfs node- make
pp_tableinvisible on VF mode (only valid on BM)
- makepp_tableinvisible on Mi* chips (Not supported)
- makepp_tableinvisible 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(-)drivers/gpu/drm/amd/pm/amdgpu_pm.c +6
-1@@ -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 ):
drivers/gpu/drm/amd/pm/amdgpu_pm.c static int default_attr_update(struct amdgpu_device *adev, struct amdgpu_device_ · line 2656
Quoted 10 lines
drivers/gpu/drm/amd/pm/amdgpu_pm.c +10
-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.
Best Regards,
Kevin
Quoted 6 lines
drivers/gpu/drm/amd/pm/amdgpu_pm.c +0
-1}switch (gc_ver) { --2.34.1
Quoted 70 lines · Yang(Kevin)
[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 ofpp_tablesysfs nodeQuoted 45 lines · Yang(Kevin)
[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 ofpp_tablesysfs node- make
pp_tableinvisible on VF mode (only valid on BM)
- makepp_tableinvisible on Mi* chips (Not supported)
- makepp_tableinvisible 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(-)drivers/gpu/drm/amd/pm/amdgpu_pm.c +6
-1@@ -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 ):drivers/gpu/drm/amd/pm/amdgpu_pm.c static int default_attr_update(struct amdgpu_device *adev, struct amdgpu_device_ · line 2656
Quoted 10 lines
drivers/gpu/drm/amd/pm/amdgpu_pm.c +10
-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)?
Quoted 9 lines
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
Quoted 10 lines
Best Regards,
KevinQuoted 6 lines
drivers/gpu/drm/amd/pm/amdgpu_pm.c +0
-1}switch (gc_ver) { --2.34.1