Hi guys,
I’m working on the Linux kernel version 3.14.52 for the target imx6qdl, I need a support from you about Adding an external watchdog reset.
I applied the patch: https://patchwork.kernel.org/patch/6502881/, but I got a strange behavior when I tried to test the patch.
I’ve remarked that the reset cause of the reboot from the u-boot traces doesn’t change (I got POR all times).
I’ve used the following commands to test (please see the files attached):
1- reboot
2- echo c > /proc/sysrq-trigger
By using the second command, I think that I will get WDOG in the reset cause, unfortunately no.
Could you please guys give a support about that ?
TIA,
Best regards,
Ilies CHERGUI
Embedded low level development engineer
Original Attachment has been moved to: watchdog_external_reset_cmd_sysrq-trigger.txt.zip
Original Attachment has been moved to: watchdog_external_reset_cmd_reboot.txt.zip
Hi Chergui,
It may take some time to reboot (depend upon memory size). The command which you have mention is correct.
Can you try by running these two commands.
1) echo 1 > /proc/sys/kernel/sysrq
If you do not want to run the above command every time then you can activate the magic sysRq at boot time
echo "kernel.sysrq =1" >> /etc/sysctl.conf
2) echo c > /proc/sysrq-trigger
Thanks,
Vinod
Hi Vinod,
I've done a test using the commands that you proposed, I got the following traces (please see the traces below).
Traces:
root@jcdbox:/ # echo 1 > /proc/sys/kernel/sysrq
root@jcdbox:/ # echo c > /proc/sysrq-trigger
SysRq : Trigger a crash
Unable to handle kernel NULL pointer dereference at virtual address 00000000
pgd = cea3c000
[00000000] *pgd=00000000
Internal error: Oops: 805 [#1] PREEMPT SMP ARM
Modules linked in:
CPU: 0 PID: 206 Comm: sh Not tainted 3.14.52-141268-g8e9d12c-dirty #78
task: cea21140 ti: cea00000 task.ti: cea00000
PC is at sysrq_handle_crash+0x30/0x40
LR is at _raw_spin_unlock_irqrestore+0x28/0x54
pc : [<c03b71b0>] lr : [<c0892418>] psr: 20010093
sp : cea01f10 ip : 0000bd94 fp : 00000000
r10: 00000000 r9 : 00000000 r8 : 00000007
r7 : 60010013 r6 : c0c9e1b8 r5 : 00000063 r4 : c0c807ec
r3 : 00000000 r2 : 00000001 r1 : a0010093 r0 : 00000001
Flags: nzCv IRQs off FIQs on Mode SVC_32 ISA ARM Segment user
Control: 10c53c7d Table: 1ea3c04a DAC: 00000015
PC: 0xc03b7130:
7130 e1a00006 e5944014 e593801c e5937020 eb1368e7 e595301c e1530008 0a000004
7150 e1a00006 eb136834 e1a00005 e8bd41f0 eafffe33 e5953020 e0874004 e1530004
7170 1afffff6 e1a00005 ebfffe16 eafffff3 e92d4008 e3a02001 e59f3028 e5832000
7190 f57ff04e e59f3020 e5933018 e3530000 0a000000 e12fff33 e3a03000 e3a02001
71b0 e5c32000 e8bd8008 c0d107bc c0c6e500 e92d4010 e24dd008 e1a04001 e28d2004
71d0 e3a01000 ebfe2b58 e3500000 ba000009 e59d3004 e3530c03 359f2020 33a00000
71f0 3594c00c 23e00015 35921000 31cc30b0 32813001 35823000 e28dd008 e8bd8010
7210 c0c9e0b4 e92d4038 e2405030 e30047ec e34c40c8 e1a01005 e3010e14 e34c00ae
LR: 0xc0892398:
2398 e49de004 eade936e e92d4008 f57ff05b e1d030b0 e2833001 e1c030b0 f57ff04a
23b8 e320f004 e3a00001 ebdf0c98 e1a0200d e3c23d7f e3c3303f e5932004 e3520000
23d8 18bd8008 e5933000 e3130002 08bd8008 e8bd4008 eafff50b e92d4008 f57ff05b
23f8 e1d030b0 e2833001 e1c030b0 f57ff04a e320f004 e121f001 e3a00001 ebdf0c83
2418 e1a0200d e3c23d7f e3c3303f e5932004 e3520000 18bd8008 e5933000 e3130002
2438 08bd8008 e8bd4008 eafff4f6 e92d4008 f57ff05b e1d030b0 e2833001 e1c030b0
2458 f57ff04a e320f004 f1080080 e3a00001 ebdf0c6e e1a0200d e3c23d7f e3c3303f
2478 e5932004 e3520000 18bd8008 e5933000 e3130002 08bd8008 e8bd4008 eafff4e1
SP: 0xcea01e90:
1e90 0000000f c006f3fc e6b95270 ce6ccc01 00000000 c0892720 00000000 00000002
1eb0 c0d13508 c03b71b0 20010093 ffffffff cea01efc c0012498 00000001 a0010093
1ed0 00000001 00000000 c0c807ec 00000063 c0c9e1b8 60010013 00000007 00000000
1ef0 00000000 00000000 0000bd94 cea01f10 c0892418 c03b71b0 20010093 ffffffff
1f10 c03b7180 c03b78e4 cea00000 00000002 00000000 00000001 00000000 00000000
1f30 00000000 c03b798c ce3ff800 c013f948 cea42a80 00000002 b64432a4 cea01f80
1f50 00000000 c00ee7ac b6f9df3c c08923c4 ce892cc0 cea42a80 cea42a80 00000002
1f70 b64432a4 00000000 00000000 c00eeb54 00000000 00000000 cea42a80 00000003
R4: 0xc0c8076c:
076c c006d334 00000000 00000000 00000000 00000000 c0c80788 00000000 c0c80790
078c 00000000 c0a9b7f4 000001b4 c006d278 00000000 00000000 00040000 00000000
07ac c0c807ac c0c807ac c0d14244 c0c88828 c0c88828 00010001 000001f4 0000000a
07cc 00000001 00000000 ffff8aee 0abb0abb 00000001 c0c807e0 c0c807e0 00000000
07ec 0000000f 00000004 00000001 00000007 ffffffff ffffffff c006ef60 c0c7f8f8
080c 00000000 00000000 00000002 000000d0 cc000131 00000001 024a024a c0c80828
082c c0c80828 00000000 00000000 00000180 00000000 74737461 00000000 c0d10e80
084c c0073084 00000000 ffffffff 00000000 00000000 00000000 00000000 00000000
R6: 0xc0c9e138:
e138 c0c9e278 c0c9e288 c0c9e298 00000000 c0c9e2a8 00000000 00000000 00000000
e158 00000000 00000000 00000000 c03b799c 00000000 c03b7278 c03b7244 00000000
e178 00000000 00000000 c0a99ad0 c08d1ac0 c0c9e188 c0c9e188 c0cb9484 c0c9e338
e198 c03b7214 c0ae1f70 c0ae1f80 00000002 c03b76ec c0ae1f94 c0ae1fa0 00000080
e1b8 c03b7180 c0ae1fac c0ae1fb8 00000008 c03b769c c0ae1fc8 c0ae1fe0 00000040
e1d8 c03b7488 c0ae1ff4 c0ae200c 00000040 c03b767c c0ae2024 c0ae2038 00000040
e1f8 c03b75e8 c0ae2048 c0ae205c 00000040 c03b7454 c0ae2088 c0ae2090 00000004
e218 c03b75e4 c0ae2094 c0ae20b8 00000008 c03b75dc c0ae20dc c0ae20f4 00000008
Process sh (pid: 206, stack limit = 0xcea00238)
Stack: (0xcea01f10 to 0xcea02000)
1f00: c03b7180 c03b78e4 cea00000 00000002
1f20: 00000000 00000001 00000000 00000000 00000000 c03b798c ce3ff800 c013f948
1f40: cea42a80 00000002 b64432a4 cea01f80 00000000 c00ee7ac b6f9df3c c08923c4
1f60: ce892cc0 cea42a80 cea42a80 00000002 b64432a4 00000000 00000000 c00eeb54
1f80: 00000000 00000000 cea42a80 00000003 00000002 00000001 00000004 c000e564
1fa0: cea00000 c000e3e0 00000003 00000002 00000001 b64432a4 00000002 0000000a
1fc0: 00000003 00000002 00000001 00000004 00000000 b6fa2404 b64432a4 00000000
1fe0: b6fa30c4 bec1c6c8 b6f8a3f3 b6f28250 20010010 00000001 00000000 00000000
[<c03b71b0>] (sysrq_handle_crash) from [<c03b78e4>] (__handle_sysrq+0x104/0x174)
[<c03b78e4>] (__handle_sysrq) from [<c03b798c>] (write_sysrq_trigger+0x38/0x48)
[<c03b798c>] (write_sysrq_trigger) from [<c013f948>] (proc_reg_write+0x58/0x80)
[<c013f948>] (proc_reg_write) from [<c00ee7ac>] (vfs_write+0xb4/0x17c)
[<c00ee7ac>] (vfs_write) from [<c00eeb54>] (SyS_write+0x44/0x84)
[<c00eeb54>] (SyS_write) from [<c000e3e0>] (ret_fast_syscall+0x0/0x38)
Code: 0a000000 e12fff33 e3a03000 e3a02001 (e5c32000)
---[ end trace 53b5b3bd273c304b ]---
Kernel panic - not syncing: Fatal exception
CPU3: stopping
CPU: 3 PID: 0 Comm: swapper/3 Tainted: G D 3.14.52-141268-g8e9d12c-dirty #78
[<c0014e9c>] (unwind_backtrace) from [<c0011a30>] (show_stack+0x10/0x14)
[<c0011a30>] (show_stack) from [<c088c260>] (dump_stack+0x64/0xb4)
[<c088c260>] (dump_stack) from [<c0013e2c>] (handle_IPI+0x1b8/0x1ec)
[<c0013e2c>] (handle_IPI) from [<c00085a8>] (gic_handle_irq+0x58/0x60)
[<c00085a8>] (gic_handle_irq) from [<c0012500>] (__irq_svc+0x40/0x70)
Exception stack(0xce09df60 to 0xce09dfa8)
df60: ce09dfa8 00000000 9139cbcd 0000000a d0f371f0 00000001 73a8bd6a 0000000a
df80: c0c79208 412fc09a 00000001 00000000 00000000 ce09dfa8 c007c2d8 c05e23a8
dfa0: 600f0013 ffffffff
[<c0012500>] (__irq_svc) from [<c05e23a8>] (cpuidle_enter_state+0x50/0xec)
[<c05e23a8>] (cpuidle_enter_state) from [<c05e2538>] (cpuidle_idle_call+0xf4/0x164)
[<c05e2538>] (cpuidle_idle_call) from [<c000f10c>] (arch_cpu_idle+0x8/0x44)
[<c000f10c>] (arch_cpu_idle) from [<c0070894>] (cpu_startup_entry+0x9c/0x138)
[<c0070894>] (cpu_startup_entry) from [<10008644>] (0x10008644)
CPU2: stopping
CPU: 2 PID: 0 Comm: swapper/2 Tainted: G D 3.14.52-141268-g8e9d12c-dirty #78
[<c0014e9c>] (unwind_backtrace) from [<c0011a30>] (show_stack+0x10/0x14)
[<c0011a30>] (show_stack) from [<c088c260>] (dump_stack+0x64/0xb4)
[<c088c260>] (dump_stack) from [<c0013e2c>] (handle_IPI+0x1b8/0x1ec)
[<c0013e2c>] (handle_IPI) from [<c00085a8>] (gic_handle_irq+0x58/0x60)
[<c00085a8>] (gic_handle_irq) from [<c0012500>] (__irq_svc+0x40/0x70)
Exception stack(0xce09bf60 to 0xce09bfa8)
bf60: ce09bfa8 00000000 9139ca80 0000000a d0f2f1f0 00000001 73a9d945 0000000a
bf80: c0c79208 412fc09a 00000001 00000000 00000000 ce09bfa8 c007c2d8 c05e23a8
bfa0: 600f0013 ffffffff
[<c0012500>] (__irq_svc) from [<c05e23a8>] (cpuidle_enter_state+0x50/0xec)
[<c05e23a8>] (cpuidle_enter_state) from [<c05e2538>] (cpuidle_idle_call+0xf4/0x164)
[<c05e2538>] (cpuidle_idle_call) from [<c000f10c>] (arch_cpu_idle+0x8/0x44)
[<c000f10c>] (arch_cpu_idle) from [<c0070894>] (cpu_startup_entry+0x9c/0x138)
[<c0070894>] (cpu_startup_entry) from [<10008644>] (0x10008644)
CPU1: stopping
CPU: 1 PID: 0 Comm: swapper/1 Tainted: G D 3.14.52-141268-g8e9d12c-dirty #78
[<c0014e9c>] (unwind_backtrace) from [<c0011a30>] (show_stack+0x10/0x14)
[<c0011a30>] (show_stack) from [<c088c260>] (dump_stack+0x64/0xb4)
[<c088c260>] (dump_stack) from [<c0013e2c>] (handle_IPI+0x1b8/0x1ec)
[<c0013e2c>] (handle_IPI) from [<c00085a8>] (gic_handle_irq+0x58/0x60)
[<c00085a8>] (gic_handle_irq) from [<c0012500>] (__irq_svc+0x40/0x70)
Exception stack(0xce099f60 to 0xce099fa8)
9f60: ce099fa8 00000000 9139d250 0000000a d0f271f0 00000001 71462102 0000000a
9f80: c0c79208 412fc09a 00000001 00000000 00000000 ce099fa8 c007c2d8 c05e23a8
9fa0: 600f0013 ffffffff
[<c0012500>] (__irq_svc) from [<c05e23a8>] (cpuidle_enter_state+0x50/0xec)
[<c05e23a8>] (cpuidle_enter_state) from [<c05e2538>] (cpuidle_idle_call+0xf4/0x164)
[<c05e2538>] (cpuidle_idle_call) from [<c000f10c>] (arch_cpu_idle+0x8/0x44)
[<c000f10c>] (arch_cpu_idle) from [<c0070894>] (cpu_startup_entry+0x9c/0x138)
[<c0070894>] (cpu_startup_entry) from [<10008644>] (0x10008644)
Rebooting in 5 seconds..
U-Boot 2014.01-sba-primary (Jan 17 2017 - 14:53:34)
CPU: Freescale i.MX6Q rev1.2 at 792 MHz
Reset cause: POR
...
Best regards,
-Ilies