drm/amd/pm: correct the metrics version for SMU 11.0.11/12/13
Alex Deucher
maintainerPATCH 1/1 drm/amd/pm: correct the metrics version for SMU 11.0.11/12/13
From: Evan Quan <[email protected]>
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.
--- .../amd/pm/swsmu/smu11/sienna_cichlid_ppt.c | 57 ++++++++++++++----- 1 file changed, 44 insertions(+), 13 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +44 -13
@@ -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,
Signature · 1 line
2.35.3
Greg KH
maintainerQuoted 6 lines · Alex Deucher
From: Evan Quan <[email protected]>
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.
Quoted 8 lines
Signed-off-by Evan Quan <[email protected]>Signed-off-by Alex Deucher <[email protected]>(cherry picked from commit 396beb91a9eb86cbfa404e4220cca8f3ada70777)--- .../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
Deucher, Alexander
maintainer[Public]
Quoted 35 lines
-----Original Message-----
From: Greg KH <[email protected]>
Sent: Wednesday, June 8, 2022 11:47 AM
To: Deucher, Alexander <[email protected]>
Cc: [email protected]; Quan, Evan <[email protected]>
Subject: Re: [PATCH] drm/amd/pm: correct the metrics version for SMU 11.0.11/12/13Quoted 9 lines · Alex Deucher
From: Evan Quan <[email protected]>
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
Quoted 1 line
alexander.deucher%40amd.com%7Cedf89fa3ab394ba5362808da496627a1% 7C3dd89
Quoted 1 line
61fe4884e608e11a82d994e183d%7C0%7C0%7C637903000346405316%7C Unknown%7CT
Quoted 1 line
WFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJ XVCI
Quoted 1 line
6Mn0%3D%7C3000%7C%7C%7C&sdata=Ro1FN8XPjNoT79lk6A450jv1CO 7ri02O1dUi
Quoted 3 lines
Bjj9cO4%3D&reserved=0
Signed-off-by Evan Quan <[email protected]>Signed-off-by Alex Deucher <[email protected]> (cherrypicked
Quoted 8 lines
Quoted 4 lines
from commit
396beb91a9eb86cbfa404e4220cca8f3ada70777)
Cc: [email protected]--- .../amd/pm/swsmu/smu11/sienna_cichlid_ppt.c | 57 ++++++++++++++-----
Quoted 1 line
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
Quoted 4 lines
thanks,
greg k-h