[AMD Official Use Only - Internal Distribution Only] Series is reviewed-by: Evan Quan <evan.quan@xxxxxxx> -----Original Message----- From: amd-gfx <amd-gfx-bounces@xxxxxxxxxxxxxxxxxxxxx> On Behalf Of Alex Deucher Sent: Saturday, August 29, 2020 1:59 AM To: amd-gfx@xxxxxxxxxxxxxxxxxxxxx Cc: Deucher, Alexander <Alexander.Deucher@xxxxxxx> Subject: [PATCH 6/6] drm/amdgpu/swsmu: handle manual fan readback on SMU11 Need to read back from registers for manual mode rather than using the metrics table. Bug: https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitlab.freedesktop.org%2Fdrm%2Famd%2F-%2Fissues%2F1164&data=02%7C01%7Cevan.quan%40amd.com%7C4fdd9ee7de274e193ebd08d84b7c125d%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637342343592341398&sdata=O20Z37%2FF61iFiAGd9o17bitxAZaSfSnZIBCeoEl68zs%3D&reserved=0 Signed-off-by: Alex Deucher <alexander.deucher@xxxxxxx> --- drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c | 11 ++++++++--- drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c | 11 ++++++++--- .../gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c | 11 ++++++++--- 3 files changed, 24 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c index f6d9b0db3e82..2ce6ad9c6609 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c @@ -1123,9 +1123,14 @@ static int arcturus_get_fan_speed_rpm(struct smu_context *smu, if (!speed) return -EINVAL; -return arcturus_get_smu_metrics_data(smu, - METRICS_CURR_FANSPEED, - speed); +switch (smu_v11_0_get_fan_control_mode(smu)) { +case AMD_FAN_CTRL_AUTO: +return arcturus_get_smu_metrics_data(smu, + METRICS_CURR_FANSPEED, + speed); +default: +return smu_v11_0_get_fan_speed_rpm(smu, speed); +} } static int arcturus_get_fan_parameters(struct smu_context *smu) diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c index 87b5f9ff4021..42d53cca7360 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c @@ -1362,9 +1362,14 @@ static int navi10_get_fan_speed_rpm(struct smu_context *smu, if (!speed) return -EINVAL; -return navi10_get_smu_metrics_data(smu, - METRICS_CURR_FANSPEED, - speed); +switch (smu_v11_0_get_fan_control_mode(smu)) { +case AMD_FAN_CTRL_AUTO: +return navi10_get_smu_metrics_data(smu, + METRICS_CURR_FANSPEED, + speed); +default: +return smu_v11_0_get_fan_speed_rpm(smu, speed); +} } static int navi10_get_fan_parameters(struct smu_context *smu) 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 863372436b98..5c22611d5878 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 @@ -1169,9 +1169,14 @@ static int sienna_cichlid_get_fan_speed_rpm(struct smu_context *smu, if (!speed) return -EINVAL; -return sienna_cichlid_get_smu_metrics_data(smu, - METRICS_CURR_FANSPEED, - speed); +switch (smu_v11_0_get_fan_control_mode(smu)) { +case AMD_FAN_CTRL_AUTO: +return sienna_cichlid_get_smu_metrics_data(smu, + METRICS_CURR_FANSPEED, + speed); +default: +return smu_v11_0_get_fan_speed_rpm(smu, speed); +} } static int sienna_cichlid_get_fan_parameters(struct smu_context *smu) -- 2.25.4 _______________________________________________ amd-gfx mailing list amd-gfx@xxxxxxxxxxxxxxxxxxxxx https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=02%7C01%7Cevan.quan%40amd.com%7C4fdd9ee7de274e193ebd08d84b7c125d%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637342343592341398&sdata=3gOUFWAaLuSkN%2FkwjCb7tO3zTgBixYU1uLGENGv9FQM%3D&reserved=0 _______________________________________________ amd-gfx mailing list amd-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/amd-gfx