From: Lijo Lazar Date: Wed, 9 Dec 2020 13:06:16 +0000 (+0800) Subject: drm/amd/pm: Set no fan control flag as needed. X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=73ab8efc7fdf683f7415c010990d9a1a16fae464;p=linux.git drm/amd/pm: Set no fan control flag as needed. For GPUs that don't support fan control, set the no fan control flag so that they don't appear in hwmon sensors. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c index 4ffe74cdd2878..21492ab4c9ac5 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c @@ -1028,6 +1028,10 @@ static int smu_sw_init(void *handle) return ret; } + /* If there is no way to query fan control mode, fan control is not supported */ + if (!smu->ppt_funcs->get_fan_control_mode) + smu->adev->pm.no_fan = true; + return 0; }