diff options
author | Hawking Zhang <Hawking.Zhang@amd.com> | 2016-12-01 17:14:45 +0800 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2016-12-06 18:08:33 -0500 |
commit | 10e2ca346bf74561ff1b7fff6287716ab976cd8c (patch) | |
tree | bd86ee6f909a5b5b49b222469e5c20c3f18d26f9 /drivers/gpu/drm/amd/powerplay/smumgr/iceland_smc.c | |
parent | 1cd99a8d97c90e04d526d843f2be950f6e4e3bd2 (diff) | |
download | blackbird-op-linux-10e2ca346bf74561ff1b7fff6287716ab976cd8c.tar.gz blackbird-op-linux-10e2ca346bf74561ff1b7fff6287716ab976cd8c.zip |
drm/amd/powerplay: bypass fan table setup if no fan connected
If vBIOS noFan bit is set, the fan table parameters in thermal controller
will not get initialized. The driver should avoid to use these uninitialized
parameter to do calculation. Otherwise, it may trigger divide 0 error.
Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Diffstat (limited to 'drivers/gpu/drm/amd/powerplay/smumgr/iceland_smc.c')
-rw-r--r-- | drivers/gpu/drm/amd/powerplay/smumgr/iceland_smc.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/iceland_smc.c b/drivers/gpu/drm/amd/powerplay/smumgr/iceland_smc.c index b579f0c175e6..a24971a33bfd 100644 --- a/drivers/gpu/drm/amd/powerplay/smumgr/iceland_smc.c +++ b/drivers/gpu/drm/amd/powerplay/smumgr/iceland_smc.c @@ -2006,6 +2006,12 @@ int iceland_thermal_setup_fan_table(struct pp_hwmgr *hwmgr) if (!phm_cap_enabled(hwmgr->platform_descriptor.platformCaps, PHM_PlatformCaps_MicrocodeFanControl)) return 0; + if (hwmgr->thermal_controller.fanInfo.bNoFan) { + phm_cap_unset(hwmgr->platform_descriptor.platformCaps, + PHM_PlatformCaps_MicrocodeFanControl); + return 0; + } + if (0 == smu7_data->fan_table_start) { phm_cap_unset(hwmgr->platform_descriptor.platformCaps, PHM_PlatformCaps_MicrocodeFanControl); return 0; |