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] [<
ffffffc00070af1c>] get_static_power+0xd8/0xe8
[ 0.827981] [<
ffffffc00070b190>] devfreq_cooling_get_requested_power+0x94/0x170
[ 0.827997] [<
ffffffc0007094c8>] power_allocator_throttle+0x270/0x804
..
Change-Id: I63f66e54d69115165a7b3ec798b9009c360daa62
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
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);