From ef2cd29548975f82b5f06d50c2a4843d8535ac8b Mon Sep 17 00:00:00 2001 From: Caesar Wang Date: Tue, 25 Apr 2017 17:53:39 +0800 Subject: [PATCH] MALI: fix thermal crash with booting up If the temperature(sbs-battery) reaches the switch_on_temp, it would try to calculate requested power of all thermal instances. Then hit the crash[0] caused by the gpu thermal sensor, since the thermal driver had not registered in time. [0] [ 0.827943] Call trace: [ 0.827953] [< (null)>] (null) [ 0.827969] [] get_static_power+0xd8/0xe8 [ 0.827981] [] devfreq_cooling_get_requested_power+0x94/0x170 [ 0.827997] [] power_allocator_throttle+0x270/0x804 .. Change-Id: I63f66e54d69115165a7b3ec798b9009c360daa62 Signed-off-by: Caesar Wang --- .../gpu/arm/midgard/backend/gpu/mali_kbase_power_model_simple.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/arm/midgard/backend/gpu/mali_kbase_power_model_simple.c b/drivers/gpu/arm/midgard/backend/gpu/mali_kbase_power_model_simple.c index d965033905ca..eeba4523199c 100644 --- a/drivers/gpu/arm/midgard/backend/gpu/mali_kbase_power_model_simple.c +++ b/drivers/gpu/arm/midgard/backend/gpu/mali_kbase_power_model_simple.c @@ -45,7 +45,7 @@ static unsigned long model_static_power(unsigned long voltage) unsigned long temp_squared, temp_cubed, temp_scaling_factor; const unsigned long voltage_cubed = (voltage * voltage * voltage) >> 10; - if (gpu_tz) { + if (!IS_ERR_OR_NULL(gpu_tz) && gpu_tz->ops->get_temp) { int ret; ret = gpu_tz->ops->get_temp(gpu_tz, &temperature); -- 2.34.1