Skip to contentSkip to conversation

amdgpu/pm: Enable sysfs nodes for pp_dpm_vclk and dclk

PATCH In review Marko Zekovic 2 participants 2 messages Mar 28, 2022 – Mar 31, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 amdgpu/pm: Enable sysfs nodes for pp_dpm_vclk and dclk

SMI clock measure API is failing on NAVI12, because sysfs node for pp_dpm_vclk is not existing. Enable sysfs node for pp_dpm_vclk.

v2: Also enable sysfs node for pp_dpm_dclk.

Change-Id I240fa055600bfc0d46dfec374339ba61764f9ab2
---
 drivers/gpu/drm/amd/pm/amdgpu_pm.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/pm/amdgpu_pm.c +4 -2
index 9ce597ded31db..a6747ebf7e569 100644
@@ -2001,11 +2001,13 @@ static int default_attr_update(struct amdgpu_device *adev, struct amdgpu_device_
 			*states = ATTR_STATE_UNSUPPORTED;
 	} else if (DEVICE_ATTR_IS(pp_dpm_vclk)) {
 		if (!(gc_ver == IP_VERSION(10, 3, 1) ||
-		      gc_ver == IP_VERSION(10, 3, 0)))
+		      gc_ver == IP_VERSION(10, 3, 0) ||
+		      gc_ver == IP_VERSION(10, 1, 2)))
 			*states = ATTR_STATE_UNSUPPORTED;
 	} else if (DEVICE_ATTR_IS(pp_dpm_dclk)) {
 		if (!(gc_ver == IP_VERSION(10, 3, 1) ||
-		      gc_ver == IP_VERSION(10, 3, 0)))
+		      gc_ver == IP_VERSION(10, 3, 0) ||
+		      gc_ver == IP_VERSION(10, 1, 2)))
 			*states = ATTR_STATE_UNSUPPORTED;
 	} else if (DEVICE_ATTR_IS(pp_power_profile_mode)) {
 		if (amdgpu_dpm_get_power_profile_mode(adev, NULL) == -EOPNOTSUPP)
Signature · 1 line
2.24.1.windows.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Marko Zekovic

SMI clock measure API is failing on NAVI12, because sysfs node for pp_dpm_vclk is not existing. Enable sysfs node for pp_dpm_vclk.

v2: Also enable sysfs node for pp_dpm_dclk.

If it's meant to be only for reading clock levels, make sure to change the attribute mode as well.

With that addressed,

Thanks,
Lijo

Quoted 26 lines

Change-Id: I240fa055600bfc0d46dfec374339ba61764f9ab2

---
  drivers/gpu/drm/amd/pm/amdgpu_pm.c | 6 ++++--
  1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/pm/amdgpu_pm.c +4 -2
index 9ce597ded31db..a6747ebf7e569 100644
@@ -2001,11 +2001,13 @@ static int default_attr_update(struct amdgpu_device *adev, struct amdgpu_device_
  			*states = ATTR_STATE_UNSUPPORTED;
  	} else if (DEVICE_ATTR_IS(pp_dpm_vclk)) {
  		if (!(gc_ver == IP_VERSION(10, 3, 1) ||
-		      gc_ver == IP_VERSION(10, 3, 0)))
+		      gc_ver == IP_VERSION(10, 3, 0) ||
+		      gc_ver == IP_VERSION(10, 1, 2)))
  			*states = ATTR_STATE_UNSUPPORTED;
  	} else if (DEVICE_ATTR_IS(pp_dpm_dclk)) {
  		if (!(gc_ver == IP_VERSION(10, 3, 1) ||
-		      gc_ver == IP_VERSION(10, 3, 0)))
+		      gc_ver == IP_VERSION(10, 3, 0) ||
+		      gc_ver == IP_VERSION(10, 1, 2)))
  			*states = ATTR_STATE_UNSUPPORTED;
  	} else if (DEVICE_ATTR_IS(pp_power_profile_mode)) {
  		if (amdgpu_dpm_get_power_profile_mode(adev, NULL) == -EOPNOTSUPP)