Commit e53dcefe authored by Timur Kristóf's avatar Timur Kristóf Committed by Alex Deucher
Browse files

drm/amd/pm: Return -EOPNOTSUPP when can't read power limit



So that hwmon_attributes_visible() will see that the power2_cap
attributes should not be visible on GPUs that don't support
the get_power_limit() function.

This fixes an error when running the "sensors" command on SI.

Fixes: 12c958d1 ("drm/amd/pm: Expose ppt1 limit for gc_v9_5_0")
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarTimur Kristóf <timur.kristof@gmail.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 966d70f1
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1569,7 +1569,7 @@ int amdgpu_dpm_get_power_limit(struct amdgpu_device *adev,
	int ret = 0;

	if (!pp_funcs->get_power_limit)
		return -ENODATA;
		return -EOPNOTSUPP;

	mutex_lock(&adev->pm.mutex);
	ret = pp_funcs->get_power_limit(adev->powerplay.pp_handle,