]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/amd/pm: Return -EOPNOTSUPP for unsupported OD_MCLK on smu_v13_0_6
authorAsad Kamal <asad.kamal@amd.com>
Wed, 18 Mar 2026 05:52:57 +0000 (13:52 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 23 Mar 2026 18:48:52 +0000 (14:48 -0400)
When SET_UCLK_MAX capability is absent, return -EOPNOTSUPP from
smu_v13_0_6_emit_clk_levels() for OD_MCLK instead of 0. This makes
unsupported OD_MCLK reporting consistent with other clock types
and allows callers to skip the entry cleanly.

Signed-off-by: Asad Kamal <asad.kamal@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit d82e0a72d9189e8acd353988e1a57f85ce479e37)
Cc: stable@vger.kernel.org
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c

index b44a85697a30adfbf1b2af23ea88e317574a2fcc..870bcc86fd79481df9b8fbe4ea1f70da7690b8e3 100644 (file)
@@ -1391,7 +1391,7 @@ static int smu_v13_0_6_emit_clk_levels(struct smu_context *smu,
                break;
        case SMU_OD_MCLK:
                if (!smu_v13_0_6_cap_supported(smu, SMU_CAP(SET_UCLK_MAX)))
-                       return 0;
+                       return -EOPNOTSUPP;
 
                size += sysfs_emit_at(buf, size, "%s:\n", "OD_MCLK");
                size += sysfs_emit_at(buf, size, "0: %uMhz\n1: %uMhz\n",