From: Evan Quan evan.quan@amd.com
Correct the metrics version used for SMU 11.0.11/12/13. Fixes misreported GPU metrics (e.g., fan speed, etc.) depending on which version of SMU firmware is loaded.
Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1925 Signed-off-by: Evan Quan evan.quan@amd.com Signed-off-by: Alex Deucher alexander.deucher@amd.com (cherry picked from commit 396beb91a9eb86cbfa404e4220cca8f3ada70777) Cc: stable@vger.kernel.org --- .../amd/pm/swsmu/smu11/sienna_cichlid_ppt.c | 57 ++++++++++++++----- 1 file changed, 44 insertions(+), 13 deletions(-)
diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c index 38f04836c82f..7a1e225fb823 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c @@ -586,12 +586,28 @@ static int sienna_cichlid_get_smu_metrics_data(struct smu_context *smu, uint16_t average_gfx_activity; int ret = 0;
- if ((smu->adev->ip_versions[MP1_HWIP][0] == IP_VERSION(11, 0, 7)) && - (smu->smc_fw_version >= 0x3A4900)) - use_metrics_v3 = true; - else if ((smu->adev->ip_versions[MP1_HWIP][0] == IP_VERSION(11, 0, 7)) && - (smu->smc_fw_version >= 0x3A4300)) - use_metrics_v2 = true; + switch (smu->adev->ip_versions[MP1_HWIP][0]) { + case IP_VERSION(11, 0, 7): + if (smu->smc_fw_version >= 0x3A4900) + use_metrics_v3 = true; + else if (smu->smc_fw_version >= 0x3A4300) + use_metrics_v2 = true; + break; + case IP_VERSION(11, 0, 11): + if (smu->smc_fw_version >= 0x412D00) + use_metrics_v2 = true; + break; + case IP_VERSION(11, 0, 12): + if (smu->smc_fw_version >= 0x3B2300) + use_metrics_v2 = true; + break; + case IP_VERSION(11, 0, 13): + if (smu->smc_fw_version >= 0x491100) + use_metrics_v2 = true; + break; + default: + break; + }
ret = smu_cmn_get_metrics_table(smu, NULL, @@ -3701,13 +3717,28 @@ static ssize_t sienna_cichlid_get_gpu_metrics(struct smu_context *smu, uint16_t average_gfx_activity; int ret = 0;
- if ((adev->ip_versions[MP1_HWIP][0] == IP_VERSION(11, 0, 7)) && - (smu->smc_fw_version >= 0x3A4900)) - use_metrics_v3 = true; - else if ((adev->ip_versions[MP1_HWIP][0] == IP_VERSION(11, 0, 7)) && - (smu->smc_fw_version >= 0x3A4300)) - use_metrics_v2 = true; - + switch (smu->adev->ip_versions[MP1_HWIP][0]) { + case IP_VERSION(11, 0, 7): + if (smu->smc_fw_version >= 0x3A4900) + use_metrics_v3 = true; + else if (smu->smc_fw_version >= 0x3A4300) + use_metrics_v2 = true; + break; + case IP_VERSION(11, 0, 11): + if (smu->smc_fw_version >= 0x412D00) + use_metrics_v2 = true; + break; + case IP_VERSION(11, 0, 12): + if (smu->smc_fw_version >= 0x3B2300) + use_metrics_v2 = true; + break; + case IP_VERSION(11, 0, 13): + if (smu->smc_fw_version >= 0x491100) + use_metrics_v2 = true; + break; + default: + break; + }
ret = smu_cmn_get_metrics_table(smu, &metrics_external,
On Wed, Jun 08, 2022 at 10:51:50AM -0400, Alex Deucher wrote:
From: Evan Quan evan.quan@amd.com
Correct the metrics version used for SMU 11.0.11/12/13. Fixes misreported GPU metrics (e.g., fan speed, etc.) depending on which version of SMU firmware is loaded.
Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1925 Signed-off-by: Evan Quan evan.quan@amd.com Signed-off-by: Alex Deucher alexander.deucher@amd.com (cherry picked from commit 396beb91a9eb86cbfa404e4220cca8f3ada70777) Cc: stable@vger.kernel.org
.../amd/pm/swsmu/smu11/sienna_cichlid_ppt.c | 57 ++++++++++++++----- 1 file changed, 44 insertions(+), 13 deletions(-)
What stable tree(s) are you wanting this backported to?
thanks,
greg k-h
[Public]
-----Original Message----- From: Greg KH gregkh@linuxfoundation.org Sent: Wednesday, June 8, 2022 11:47 AM To: Deucher, Alexander Alexander.Deucher@amd.com Cc: stable@vger.kernel.org; Quan, Evan Evan.Quan@amd.com Subject: Re: [PATCH] drm/amd/pm: correct the metrics version for SMU 11.0.11/12/13
On Wed, Jun 08, 2022 at 10:51:50AM -0400, Alex Deucher wrote:
From: Evan Quan evan.quan@amd.com
Correct the metrics version used for SMU 11.0.11/12/13. Fixes misreported GPU metrics (e.g., fan speed, etc.) depending on which version of SMU firmware is loaded.
Bug: https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitl ab.freedesktop.org%2Fdrm%2Famd%2F-
%2Fissues%2F1925&data=05%7C01%7C
alexander.deucher%40amd.com%7Cedf89fa3ab394ba5362808da496627a1% 7C3dd89
61fe4884e608e11a82d994e183d%7C0%7C0%7C637903000346405316%7C Unknown%7CT
WFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJ XVCI
6Mn0%3D%7C3000%7C%7C%7C&sdata=Ro1FN8XPjNoT79lk6A450jv1CO 7ri02O1dUi
Bjj9cO4%3D&reserved=0 Signed-off-by: Evan Quan evan.quan@amd.com Signed-off-by: Alex Deucher alexander.deucher@amd.com (cherry
picked
from commit 396beb91a9eb86cbfa404e4220cca8f3ada70777) Cc: stable@vger.kernel.org
.../amd/pm/swsmu/smu11/sienna_cichlid_ppt.c | 57 ++++++++++++++----
1 file changed, 44 insertions(+), 13 deletions(-)
What stable tree(s) are you wanting this backported to?
Ideally all stable kernels, but I think it will only apply cleanly to 5.18. I'll look at a backport for older stable kernels.
Alex
thanks,
greg k-h
linux-stable-mirror@lists.linaro.org