I work with a custom board based on the sabresd board, and with the freescale kernel 3.10.31.
In order to reduce the power consumption of the RTC when the board is powered off, we have installed an external I2C RTC, and really powered off the internal imx6q SNVS RTC when the board is powered off.
In order to have to have my external RTC named /dev/rtc0 by linux and thus used as main RTC, I have disabled the driver for the SNVS RTC in linux :
# CONFIG_RTC_DRV_SNVS is not set
When rebooting (with the 'reboot' command) with my new kernel, everything works fine
However, when doing a cold boot (after a power off), my kernel get stuck after the following message :
platform caam_sm: caam_sm_test: 32-byte key test match OK
then waits 21 seconds, and then issue an error message about RCU stall :
INFO: rcu_sched self-detected stall on CPU { 0} (t=2100 jiffies g=4294967011 c=4294967010 q=36)
CPU: 0 PID: 1 Comm: swapper/0 Tainted: G | D 3.10.31-82589-g9cbb064-dirty #310 |
[<8001472c>] (unwind_backtrace+0x0/0xf8) from [<80011558>] (show_stack+0x10/0x14)
INFO: rcu_sched detected stalls on CPUs/tasks: { 0} (detected by 1, t=2102 jiffies, g=4294967011, c=4294967010, q=36)
Task dump for CPU 0:
swapper/0 R running 0 1 0 0x00000000
[<805d4284>] (__schedule+0x1e4/0x5e0) from [<00000000>] ( (null))
[<80011558>] (show_stack+0x10/0x14) from [<8007c940>] (rcu_check_callbacks+0x1e4/0x690)
[<8007c940>] (rcu_check_callbacks+0x1e4/0x690) from [<80034960>] (update_process_times+0x38/0x64)
[<80034960>] (update_process_times+0x38/0x64) from [<8006362c>] (tick_sched_timer+0x48/0x78)
[<8006362c>] (tick_sched_timer+0x48/0x78) from [<80047fb0>] (__run_hrtimer.isra.30+0x54/0xe0)
[<80047fb0>] (__run_hrtimer.isra.30+0x54/0xe0) from [<80048a30>] (hrtimer_interrupt+0x108/0x2d0)
[<80048a30>] (hrtimer_interrupt+0x108/0x2d0) from [<800140d4>] (twd_handler+0x2c/0x40)
[<800140d4>] (twd_handler+0x2c/0x40) from [<80077744>] (handle_percpu_devid_irq+0x68/0x84)
[<80077744>] (handle_percpu_devid_irq+0x68/0x84) from [<8007417c>] (generic_handle_irq+0x20/0x30)
[<8007417c>] (generic_handle_irq+0x20/0x30) from [<8000e900>] (handle_IRQ+0x38/0x90)
[<8000e900>] (handle_IRQ+0x38/0x90) from [<800085a4>] (gic_handle_irq+0x28/0x5c)
[<800085a4>] (gic_handle_irq+0x28/0x5c) from [<8000dc80>] (__irq_svc+0x40/0x50)
Exception stack(0xcc079dc0 to 0xcc079e08)
9dc0: 00000001 00000000 00000000 00000000 00000040 00000034 cc078000 f4a00100
9de0: 80c77940 00000000 80bf2080 00000000 0000000a cc079e08 8002e9b4 8002ea1c
9e00: 20000113 ffffffff
[<8000dc80>] (__irq_svc+0x40/0x50) from [<8002ea1c>] (__do_softirq+0x7c/0x1b8)
[<8002ea1c>] (__do_softirq+0x7c/0x1b8) from [<8002ec00>] (do_softirq+0x4c/0x58)
[<8002ec00>] (do_softirq+0x4c/0x58) from [<8002ee74>] (irq_exit+0x90/0xc8)
[<8002ee74>] (irq_exit+0x90/0xc8) from [<8000e904>] (handle_IRQ+0x3c/0x90)
[<8000e904>] (handle_IRQ+0x3c/0x90) from [<800085a4>] (gic_handle_irq+0x28/0x5c)
[<800085a4>] (gic_handle_irq+0x28/0x5c) from [<8000dc80>] (__irq_svc+0x40/0x50)
Exception stack(0xcc079e80 to 0xcc079ec8)
9e80: 00000006 cc490c10 80ae7474 80abcfe8 cc079ee4 cc490c10 00000006 00000004
9ea0: 80bf8520 8000001d 80bf8580 00000000 cc440100 cc079ec8 802b540c 802b4bd4
9ec0: 60000113 ffffffff
[<8000dc80>] (__irq_svc+0x40/0x50) from [<802b4bd4>] (dev_printk_emit+0x0/0x2c)
Does the snvs rtc driver actually does something mandatory for the good working of the kernel, and not only the RTC function ?
Is there another way to get my RTC as /dev/rtc0 instead of disabling the snvs driver ?
I have found a workaround for my problem : actually the caam crypto module driver was enabled in my linux config although I do not use it,
and the kernel blocked in the caam driver. I disabled the caam driver in my .config file, and the problem disappeared.
# CONFIG_CRYPTO_DEV_FSL_CAAM is not set
such "rcu_sched" messages just shows that smth wrong with driver
installation
https://www.kernel.org/doc/Documentation/RCU/stallwarn.txt
~igor
I surmise the caam driver expects implicitly, in its initialisation phase, something (what ?) to be initialized by the snvs rtc driver, but does not verify that it is initialized, and does not attempt to initialize it himself.
just to summarize :
if I first boot to a kernel with the SNVS RTC driver enabled, and afterwards reboot (without powering off) into a kernel with the SNVS RTC driver disabled, my kernel boots fine.
If I boot directly from power off into the kernel with the SNVS RTC disabled, my kernel hangs in the boot phase.
How can I have my external I2C RTC used as main RTC clock ? (either with or without the snvs rtc driver enabled)