Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

amdgpu/pm: Disallow managing power profiles on SRIOV for Sienna Cichlid

Managing power profiles mode is not allowed in SRIOV mode for Sienna
Cichlid. This patch is adjusting the "pp_power_profile_mode" and
"power_dpm_force_performance_level" accordingly.

Signed-off-by: Danijel Slivka <danijel.slivka@amd.com>
Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Danijel Slivka and committed by
Alex Deucher
1b852572 cae5c1ab

+9
+9
drivers/gpu/drm/amd/pm/amdgpu_pm.c
··· 2025 2025 } else if (DEVICE_ATTR_IS(pp_power_profile_mode)) { 2026 2026 if (amdgpu_dpm_get_power_profile_mode(adev, NULL) == -EOPNOTSUPP) 2027 2027 *states = ATTR_STATE_UNSUPPORTED; 2028 + else if (gc_ver == IP_VERSION(10, 3, 0) && amdgpu_sriov_vf(adev)) 2029 + *states = ATTR_STATE_UNSUPPORTED; 2028 2030 } 2029 2031 2030 2032 switch (gc_ver) { ··· 2037 2035 DEVICE_ATTR_IS(pp_dpm_socclk) || 2038 2036 DEVICE_ATTR_IS(pp_dpm_fclk)) { 2039 2037 dev_attr->attr.mode &= ~S_IWUGO; 2038 + dev_attr->store = NULL; 2039 + } 2040 + break; 2041 + case IP_VERSION(10, 3, 0): 2042 + if (DEVICE_ATTR_IS(power_dpm_force_performance_level) && 2043 + amdgpu_sriov_vf(adev)) { 2044 + dev_attr->attr.mode &= ~0222; 2040 2045 dev_attr->store = NULL; 2041 2046 } 2042 2047 break;