Commit 2d51f3af authored by Perry Yuan's avatar Perry Yuan Committed by Alex Deucher
Browse files

drm/amdgpu: skip the invalid workload type



If some invalid workload types exposed by the power profile sysfs node,
it will be failed to set the unsuported profiles.
So we can skip to show the invalid workload type in the profiles list to
avoid that failure happen.

Acked-by: default avatarKenneth Feng <kenneth.feng@amd.com>
Reviewed-by: default avatarEvan Quan <evan.quan@amd.com>
Signed-off-by: default avatarPerry Yuan <perry.yuan@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent dc622367
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1587,7 +1587,9 @@ static int smu_v13_0_0_get_power_profile_mode(struct smu_context *smu,
		workload_type = smu_cmn_to_asic_specific_index(smu,
							       CMN2ASIC_MAPPING_WORKLOAD,
							       i);
		if (workload_type < 0)
		if (workload_type == -ENOTSUPP)
			continue;
		else if (workload_type < 0)
			return -EINVAL;

		result = smu_cmn_update_table(smu,
+3 −1
Original line number Diff line number Diff line
@@ -1479,7 +1479,9 @@ static int smu_v13_0_7_get_power_profile_mode(struct smu_context *smu, char *buf
		workload_type = smu_cmn_to_asic_specific_index(smu,
							       CMN2ASIC_MAPPING_WORKLOAD,
							       i);
		if (workload_type < 0) {
		if (workload_type == -ENOTSUPP)
			continue;
		else if (workload_type < 0) {
			result = -EINVAL;
			goto out;
		}