Linux kernel sometimes lock for a few instants

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Linux kernel sometimes lock for a few instants

1,283 Views
leonardoprates
Contributor III

I have a custom board with IMX6Q and all works good. In this board I have an external watchdog that resets the board if your input pin doesn't toggle in less than 1.6 seconds. Sometimes just after linux starts the board reboot (not always, 1 time in each 30 boots). I have looked with a scope and when this happens the driver that toggle the pin locks for more than 1.6s and my WDT reboots the board. But this lock doesn't occur only in that device driver, I have for example a led associated with kernel heartbeat function and this led locks too at same time. If I disconnect WDT from RST line I can see that when linux boot with this issue the kernel locks for 3 or 4 seconds and remains locking in aleatory way in the time until I reboot the board, but if Linux boots without the issue this never happens. No error message occurs at boot in any situation.

In resume: if board boots with problem, sometimes some drivers lock for a few seconds, without any warning or error message. After lock, kernel continue as if nothing had happened.

                  if board boots without problem, I can't see any kind of locking.

This happens only if CPU is in idle condition. If board boots wtih problem and I put some program to run I can't see lock anymore while program is running. If I stop the program, the lock starts again.

My kernel is 3.10.17 from Freescale made with Yocto and the kernel preemption is enable.

Thanks for any help,

Leonardo

Labels (4)
0 Kudos
7 Replies

972 Views
leonardoprates
Contributor III

Hi Igor, I redefine it to zero, but error still occur. Any suggestion about how try discover where kernel locks? I have tried enable ftrace, but I get a lot of compiler errors in Freescale drivers.

0 Kudos

972 Views
igorpadykov
NXP Employee
NXP Employee

Hi Leonardo

I would suggest to try with L3.10.17_1.0.2_iMX6QDLS_BUNDLE

it fixed many issues

~igor

0 Kudos

972 Views
leonardoprates
Contributor III

Hi Igor, I use this version yet.

Apparently I solved my problem using this in a boot script:

echo 1 > /sys/devices/system/cpu/cpu0/cpuidle/state0/disable

echo 1 > /sys/devices/system/cpu/cpu0/cpuidle/state1/disable

echo 1 > /sys/devices/system/cpu/cpu1/cpuidle/state0/disable

echo 1 > /sys/devices/system/cpu/cpu1/cpuidle/state1/disable

echo 1 > /sys/devices/system/cpu/cpu2/cpuidle/state0/disable

echo 1 > /sys/devices/system/cpu/cpu2/cpuidle/state1/disable

echo 1 > /sys/devices/system/cpu/cpu3/cpuidle/state0/disable

echo 1 > /sys/devices/system/cpu/cpu3/cpuidle/state1/disable

I have tryed disable cpu idle in kernel menuconfig, but If I disable a lot of compile errors occurs.

I think that error occurs in others boards, but you can see only if you have an external watchdog rebooting the board, because without one, when the behavior occurs any processing or console input start board again. This cpu_idle apparently stops some drivers to run for a few instants, but no suspend signal is sent to drivers to inform that CPU will stops for a few instants and the WDT reboots the board.

Leonardo

0 Kudos

972 Views
leonardoprates
Contributor III
0 Kudos

972 Views
igorpadykov
NXP Employee
NXP Employee

Hi Leonardo

you can check if this related to gpu power down:

gcdPOWEROFF_TIMEOUT

gc_hal_options.h - chromecast-mirrored-source - Mirror of open source software used in Chromecast de...

and install latest patches with L3.10.17_1.0.2_iMX6QDLS_BUNDLE

and preferably L3.10.53_1.1.0_iMX6QDLS_Bundle

Best regards

igor

0 Kudos

972 Views
leonardoprates
Contributor III

Hi Igor, I have to undefine this?

Leonardo

0 Kudos

972 Views
igorpadykov
NXP Employee
NXP Employee

Leonardo

you can give a try setting it to zero.

~igor

0 Kudos