]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/amd/pm: Return -EOPNOTSUPP when can't read power limit
authorTimur Kristóf <timur.kristof@gmail.com>
Mon, 19 Jan 2026 20:36:25 +0000 (21:36 +0100)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 21 Jan 2026 19:22:11 +0000 (14:22 -0500)
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: 12c958d1db36 ("drm/amd/pm: Expose ppt1 limit for gc_v9_5_0")
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/pm/amdgpu_dpm.c

index b27e4c2e550ff344d5b96dd9eaf4f1b2f65f40c3..4214f7314963f11d6ca71c0d469031b6856aa3eb 100644 (file)
@@ -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,