Kernel 5.10.72 Reboots during suspend if I change the thermal governor to bang_bang.

cancel
Showing results for 
Search instead for 
Did you mean: 

Kernel 5.10.72 Reboots during suspend if I change the thermal governor to bang_bang.

189 Views
dennis3
Contributor V

I am currently attempting to port our device to Android 11 2.6.0.  We have Android 11 2.2.0 working properly.

Our device has an active cooling fan that is enabled with a GPIO.  Because this fan is not pwm driven, it's either on or off so we change the thermal governor to bang_bang.  The default governor step_wise causes the fan to enable/disable before the temperature trigger point is reached and is undesirable behavior. (This is a known kernel issue and the recommended fix for a gpio based fan is to use the bang bang governor.)

1) Modify kernel config w/ CONFIG_THERMAL_GOV_BANG_BANG=y

2) in init.rc  echo bang_bang > /sys/class/thermal/thermal_zone0/policy

This works properly to to have the fan trigger at the trip point on stay off when the device is cool.

Everything works as expected with the 5.10.35 kernel but with 5.10.72 when the device enters suspend, it reboots after 10-15 seconds.  There is no dmesg or console output or other info I've found for debugging. 

Any suggestions how to debug or fix this?  If I simply leave the governor set to step_wise, suspend works properly and the device does not reboot.

 

Labels (2)
0 Kudos
6 Replies

167 Views
Qmiller
NXP Employee
NXP Employee

You can add some log print in bang_bang driver.This could be a problem caused by a kernel version upgrade

 

0 Kudos

160 Views
dennis3
Contributor V

Thanks @Qmiller 

I did place a number of print statements in the bang_bang driver but nothing appeared.  I found that between the two kernel versions, nothing has really changed in the governor code.  Further, I created an alternate thermal zone to test the bang_bang gov by itself without the arm cores in the cooling maps and there was no power off.  So it seems to be some interaction between the type of governor and the arm cores.  Unfortunately, I haven't found a solution yet.

0 Kudos

150 Views
Qmiller
NXP Employee
NXP Employee

Hi @dennis3 

You can see more HAL layer log when this issue appears if you see the thermal hal code :

https://source.codeaurora.org/external/imx/android-imx/platform/hardware/imx/tree/thermal/thermal-he...

Perhaps a useful error message will appear.

 

0 Kudos

142 Views
dennis3
Contributor V

@Qmiller 

OK here is logcat output from sleep to reboot:

06-15 20:11:23.219  1969  1969 D MAIN_ACTIVITY: Going to sleep!
06-15 20:11:24.307     0     0 I         : [   T33] thermal thermal_zone0: Trip0[temp=80000]:temp=58000:hyst=1999
06-15 20:11:24.307     0     0 I         : [   T33] thermal cooling_device1: target=0
06-15 20:11:24.307     0     0 I         : [   T33] thermal cooling_device3: target=0
06-15 20:11:24.307     0     0 I         : [   T33] thermal thermal_zone0: Trip2[temp=20000]:temp=58000:hyst=2000
06-15 20:11:24.307     0     0 I         : [   T33] thermal cooling_device0: target=1
06-15 20:11:24.307     0     0 I         : [   T33] thermal thermal_zone0: Trip3[temp=75000]:temp=58000:hyst=2000
06-15 20:11:24.307     0     0 I         : [   T33] thermal cooling_device0: target=0
06-15 20:11:26.323     0     0 I         : [   T33] thermal thermal_zone0: Trip0[temp=80000]:temp=57000:hyst=1999
06-15 20:11:26.323     0     0 I         : [   T33] thermal cooling_device1: target=0
06-15 20:11:26.323     0     0 I         : [   T33] thermal cooling_device3: target=0
06-15 20:11:26.323     0     0 I         : [   T33] thermal thermal_zone0: Trip2[temp=20000]:temp=57000:hyst=2000
06-15 20:11:26.323     0     0 I         : [   T33] thermal cooling_device0: target=1
06-15 20:11:26.323     0     0 I         : [   T33] thermal thermal_zone0: Trip3[temp=75000]:temp=57000:hyst=2000
06-15 20:11:26.323     0     0 I         : [   T33] thermal cooling_device0: target=0
06-15 20:11:28.016   581   620 W ActivityTaskManager: Sleep timeout!  Sleeping now.
06-15 20:11:28.120     0     0 I [ T3061] PM: suspend entry (deep)



U-Boot SPL 2021.04-00026-ge4dd254887 (Apr 11 20
U-Boot SPL 2021.04-00026-ge4dd254887 (Apr 11 2022 - 17:00:19 -0600)
SEC0:  RNG instantiated
Normal Boot
Trying to boot from BOOTROM
image offset 0x0, pagesize 0x200, ivt offset 0x0


U-Boot 2021.04-00026-ge4dd254887 (Apr 11 2022 - 17:00:19 -0600)

CPU:   i.MX8MP[8] rev1.1 1800 MHz (running at 1200 MHz)
CPU:   Commercial temperature grade (0C to 95C) at 57C

 

There is no output once the system goes to sleep.  Only the problem that the device powers off and reboots instead of staying in the sleep state.

0 Kudos

134 Views
Qmiller
NXP Employee
NXP Employee

I am compiling this Android version, can you share all command you use?

0 Kudos

126 Views
dennis3
Contributor V

Thanks,

I'm just using the root level command provided by the release.

> ./imx-make.sh bootimage

Our kernel is customized to have the addition of our own display drivers, touch screen and a few other drivers.  These modifications shouldn't have any impact on the thermal management though (Also, I can reproduce the same issue on our development board without the mods)

0 Kudos