drm/amd/powerplay: bypass fan table setup if no fan connected
Subsystems (2)
PATCH 1/1 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.
--- drivers/gpu/drm/amd/powerplay/smumgr/fiji_smc.c | 6 ++++++ drivers/gpu/drm/amd/powerplay/smumgr/iceland_smc.c | 6 ++++++ drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smc.c | 6 ++++++ drivers/gpu/drm/amd/powerplay/smumgr/tonga_smc.c | 6 ++++++ 4 files changed, 24 insertions(+)
drivers/gpu/drm/amd/powerplay/smumgr/fiji_smc.c +6 -0
@@ -1958,6 +1958,12 @@ int fiji_thermal_setup_fan_table(struct pp_hwmgr *hwmgr)int res;uint64_t tmp64; +if (hwmgr->thermal_controller.fanInfo.bNoFan) { +phm_cap_unset (hwmgr->platform_descriptor.platformCaps, + PHM_PlatformCaps_MicrocodeFanControl); +return 0 ; + } +if (smu_data->smu7_data.fan_table_start ==0 ) {phm_cap_unset (hwmgr->platform_descriptor.platformCaps, PHM_PlatformCaps_MicrocodeFanControl);
drivers/gpu/drm/amd/powerplay/smumgr/iceland_smc.c +6 -0
@@ -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 ;
drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smc.c +6 -0
@@ -1885,6 +1885,12 @@ int polaris10_thermal_setup_fan_table(struct pp_hwmgr *hwmgr)int res;uint64_t tmp64; +if (hwmgr->thermal_controller.fanInfo.bNoFan) { +phm_cap_unset (hwmgr->platform_descriptor.platformCaps, + PHM_PlatformCaps_MicrocodeFanControl); +return 0 ; + } +if (smu_data->smu7_data.fan_table_start ==0 ) {phm_cap_unset (hwmgr->platform_descriptor.platformCaps, PHM_PlatformCaps_MicrocodeFanControl);
drivers/gpu/drm/amd/powerplay/smumgr/tonga_smc.c +6 -0
@@ -2496,6 +2496,12 @@ int tonga_thermal_setup_fan_table(struct pp_hwmgr *hwmgr) 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 == smu_data->smu7_data.fan_table_start) {phm_cap_unset (hwmgr->platform_descriptor.platformCaps, PHM_PlatformCaps_MicrocodeFanControl);
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1480583737-2408-1-git-send-email-Hawking.Zhang-5C7GfCeVMHo@public.gmane.org
Deucher, Alexander
Reviewed-by Alex DeucherQuoted 9 lines
-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Hawking Zhang
Sent: Thursday, December 01, 2016 4:16 AM
To: [email protected]
Cc: Zhang, Hawking
Subject: [PATCH] drm/amd/powerplay: bypass fan table setup if no fan connected
Quoted 6 lines
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.
Change-Id I76680a5ec5411f59742b65bb70eb7b4a08bda3efSigned-off-by Hawking Zhang <[email protected]>
Quoted 86 lines
--- drivers/gpu/drm/amd/powerplay/smumgr/fiji_smc.c | 6 ++++++ drivers/gpu/drm/amd/powerplay/smumgr/iceland_smc.c | 6 ++++++ drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smc.c | 6 ++++++ drivers/gpu/drm/amd/powerplay/smumgr/tonga_smc.c | 6 ++++++ 4 files changed, 24 insertions(+)drivers/gpu/drm/amd/powerplay/smumgr/fiji_smc.c +6
-0@@ -1958,6 +1958,12 @@ int fiji_thermal_setup_fan_table(struct pp_hwmgr *hwmgr)int res;uint64_t tmp64; +if (hwmgr->thermal_controller.fanInfo.bNoFan) { +phm_cap_unset (hwmgr->platform_descriptor.platformCaps, + PHM_PlatformCaps_MicrocodeFanControl); +return 0 ; + } +if (smu_data->smu7_data.fan_table_start ==0 ) { phm_cap_unset(hwmgr->platform_descriptor.platformCaps,drivers/gpu/drm/amd/powerplay/smumgr/fiji_smc.c +0
-0PHM_PlatformCaps_MicrocodeFanControl);drivers/gpu/drm/amd/powerplay/smumgr/iceland_smc.c +6
-0@@ -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);drivers/gpu/drm/amd/powerplay/smumgr/iceland_smc.c +0
-0return 0 ;drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smc.c +6
-0@@ -1885,6 +1885,12 @@ int polaris10_thermal_setup_fan_table(struct pp_hwmgr *hwmgr)int res;uint64_t tmp64; +if (hwmgr->thermal_controller.fanInfo.bNoFan) { +phm_cap_unset (hwmgr->platform_descriptor.platformCaps, + PHM_PlatformCaps_MicrocodeFanControl); +return 0 ; + } +if (smu_data->smu7_data.fan_table_start ==0 ) { phm_cap_unset(hwmgr->platform_descriptor.platformCaps,drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smc.c +0
-0PHM_PlatformCaps_MicrocodeFanControl);drivers/gpu/drm/amd/powerplay/smumgr/tonga_smc.c +6
-0@@ -2496,6 +2496,12 @@ int tonga_thermal_setup_fan_table(struct pp_hwmgr *hwmgr) 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 == smu_data->smu7_data.fan_table_start) {phm_cap_unset(hwmgr->platform_descriptor.platformCaps,
Quoted 8 lines
PHM_PlatformCaps_MicrocodeFanControl);--
2.7.4_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): MWHPR12MB169496EA79EF64BED724E885F78F0-Gy0DoCVfaSW4WA4dJ5YXGAdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org
Bernhard Froemel
Tested-byQuoted 9 lines · Alexander
Quoted 9 lines
-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Hawking Zhang
Sent: Thursday, December 01, 2016 4:16 AM
To: [email protected]
Cc: Zhang, Hawking
Subject: [PATCH] drm/amd/powerplay: bypass fan table setup if no fan connected
Quoted 8 lines
Quoted 6 lines
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.
Change-Id I76680a5ec5411f59742b65bb70eb7b4a08bda3efSigned-off-by Hawking Zhang <[email protected]>Reviewed-by Alex Deucher <[email protected]>
Thanks, this exactly fixes one of the issues with the MacBookPro13,3:
https://lists.freedesktop.org/archives/amd-gfx/2016-November/003673.html
Quoted 91 lines
Quoted 91 lines
--- drivers/gpu/drm/amd/powerplay/smumgr/fiji_smc.c | 6 ++++++ drivers/gpu/drm/amd/powerplay/smumgr/iceland_smc.c | 6 ++++++ drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smc.c | 6 ++++++ drivers/gpu/drm/amd/powerplay/smumgr/tonga_smc.c | 6 ++++++ 4 files changed, 24 insertions(+)drivers/gpu/drm/amd/powerplay/smumgr/fiji_smc.c +6
-0@@ -1958,6 +1958,12 @@ int fiji_thermal_setup_fan_table(struct pp_hwmgr *hwmgr)int res;uint64_t tmp64; +if (hwmgr->thermal_controller.fanInfo.bNoFan) { +phm_cap_unset (hwmgr->platform_descriptor.platformCaps, + PHM_PlatformCaps_MicrocodeFanControl); +return 0 ; + } +if (smu_data->smu7_data.fan_table_start ==0 ) { phm_cap_unset(hwmgr->platform_descriptor.platformCaps,PHM_PlatformCaps_MicrocodeFanControl);drivers/gpu/drm/amd/powerplay/smumgr/iceland_smc.c +6
-0@@ -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;drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smc.c +6
-0@@ -1885,6 +1885,12 @@ int polaris10_thermal_setup_fan_table(struct pp_hwmgr *hwmgr)int res;uint64_t tmp64; +if (hwmgr->thermal_controller.fanInfo.bNoFan) { +phm_cap_unset (hwmgr->platform_descriptor.platformCaps, + PHM_PlatformCaps_MicrocodeFanControl); +return 0 ; + } +if (smu_data->smu7_data.fan_table_start ==0 ) { phm_cap_unset(hwmgr->platform_descriptor.platformCaps,PHM_PlatformCaps_MicrocodeFanControl);drivers/gpu/drm/amd/powerplay/smumgr/tonga_smc.c +6
-0@@ -2496,6 +2496,12 @@ int tonga_thermal_setup_fan_table(struct pp_hwmgr *hwmgr) 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 == smu_data->smu7_data.fan_table_start) {phm_cap_unset(hwmgr->platform_descriptor.platformCaps, PHM_PlatformCaps_MicrocodeFanControl);--
2.7.4
Quoted 8 lines
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx