Skip to contentSkip to conversation

drm/amd/pm: return -EOPNOTSUPP for pp_dpm_fclk on SMU v13.0.5

PATCH New Satyanarayana Yandapalli 1 participant 2 messages Nov 26

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

cover drm/amd/pm: return -EOPNOTSUPP for pp_dpm_fclk on SMU v13.0.5

The pp_dpm_fclk sysfs node is expected to expose FCLK DPM information when supported by the underlying SMU implementation.

On devices using SMU v13.0.5, FCLK information is not exposed through SmuMetrics. As a result, the driver cannot retrieve a valid FCLK value for userspace.

Before this change, reading pp_dpm_fclk returned an empty file, which does not clearly indicate that the functionality is unsupported on the platform.

Add explicit handling for SMU_FCLK in emit_clk_levels() and return -EOPNOTSUPP when FCLK data is unavailable from firmware. This provides a proper error notification to userspace instead of silently returning an empty result.

Before:

  $ wc -c < /sys/bus/pci/devices/0000:06:00.0/pp_dpm_fclk
  1
  $ od -An -tx1 /sys/bus/pci/devices/0000:06:00.0/pp_dpm_fclk
   0a

After:

  $ wc -c < /sys/bus/pci/devices/0000:06:00.0/pp_dpm_fclk
  wc: 'standard input': Operation not supported
  $ od -An -tx1 /sys/bus/pci/devices/0000:06:00.0/pp_dpm_fclk
  od: '/sys/bus/pci/devices/0000:06:00.0/pp_dpm_fclk': Operation not supported

Satyanarayana Yandapalli (1):
drm/amd/pm: return -EOPNOTSUPP for pp_dpm_fclk on SMU v13.0.5

 drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_5_ppt.c | 2 ++
 1 file changed, 2 insertions(+)
Signature · 1 line
2.53.0
#1 lore raw

PATCH 1/1 drm/amd/pm: return -EOPNOTSUPP for pp_dpm_fclk on SMU v13.0.5

SMU v13.0.5 exposes pp_dpm_fclk, but FCLK information is not available through SmuMetrics. As a result, amdgpu cannot obtain and report FCLK levels for userspace.

Reading pp_dpm_fclk currently returns an empty result, which does not clearly indicate that FCLK reporting is unsupported on this platform.

Handle SMU_FCLK explicitly and return -EOPNOTSUPP so userspace receives a proper error instead of an empty response.

---
 drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_5_ppt.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_5_ppt.c +2 -0
index f95b15af436d..c48e59a745e8 100644
@@ -928,6 +928,8 @@ static int smu_v13_0_5_emit_clk_levels(struct smu_context *smu,
 		size += sysfs_emit_at(buf, size, "2: %uMhz %s\n", max,
 				i == 2 ? "*" : "");
 		break;
+	case SMU_FCLK:
+		return -EOPNOTSUPP;
 	default:
 		break;
 	}
Signature · 1 line
2.53.0