I'm currently working on a solution that uses kexec to switch kernels on the fly without a full system restart. So far I have it functioning after some modification to the kexec-tools to allow for a larger dtb file, but unfortunately I intermittently get failures and the system will hang instead of starting the new kernel. I was wondering if anyone has got kexec working reliably on an i.MX6?
Hi Chris,
I am currently investigating the same issue. Were you able to solve this issue?
Regards,
Fabio Estevam
Hi Chris,
Got it running with kernel 3.14 and also 4.1-rc on a mx6quad.
I had issues with mx6solo though, which I will investigate later.
Here are my logs:
root@wandboard-solo:~# kexec -d -l /tmp/zImage --dtb /tmp/imx6q-sabresd.dtb --co - Pastebin.com
Fabio,
How far have you taken testing of this fix? I found the only way to be certain that any changes actually fixed the issue was to leave the system in a kexec loop for a long period of time.
I rebooted the system several times via kexec and did not see any failure.
I recommend attempting the method I mentioned of looping kexec for a significant length of time to test it thoroughly. During my troubleshooting over a year ago I found that you may get numerous successful kexec executions in a row and then the system would lock. Sometimes it went for several minutes of looping, other times several hours, but also I'd see it happen on the first attempt.
If I recall correctly we were running the 3.10.17 kernel release and to get kexec working correctly we had to make some changes around the clock gating. I'm unsure if this ever made it to the BSP or if another workaround was found.
Ok, thanks for the suggestion, Chris.
Chris,
I saw an issue on the serial driver during the kexec tests and I fixed it with this commit:
Regards,
Fabio Estevam
Hi FabioEstevam,
I have the same issue here with imx6ull board. I tried the two patches from this topic :
- kernel/git/next/linux-next.git - The linux-next integration testing tree
But same result .. SMP is disable
I am using the freescale releasel : rel_imx_4.1.15_2.1.0_ga
My kernel parameter to configure kdump:
# cat /proc/cmdline
console=ttymxc0,115200 cma=96M root=/dev/mmcblk1p8 rootwait rw crashkernel=50M@0x81000000
iomem seems to be good :
script to test kexec :
I run the script with success :
Finally I tried to execute it :
Nothing after that. No more output. My board is freeze.
Hi Arthur,
Please start a new thread as the original one is from 2014.
Also, please use a more recent kernel, such as NXP 4.9 or mainline 4.15.
Regards,
Fabio Estevam
Hi Fabio,
My customer had some troubles to enable kexec on 3.10.17 kernel.
Could you give more information on how to enable kexec at your side?
If you can share any guide document or reference, it would be very helpful for us.
Especially I want to know which version of kexec you used(in yocto package? or seperately downloaded?) and whether there is any special difference between kernel versions.
Hi Yong,
I tested kexec on mx6 using FSL 3.14 kernel and also mainline 4.1.
With mainline kernel it works out of the box. With 3.14 kernel we need to apply the following patch:
I haven't tested kexec with 3.10, but you probably need to adapt this patch to 3.10 and give it a try.
I used the kexec version that is provided by Yocto fido.
The commands I used are posted here:
root@wandboard-solo:~# kexec -d -l /tmp/zImage --dtb /tmp/imx6q-sabresd.dtb --co - Pastebin.com
Regards,
Fabio Estevam
Hi Fabio,
I tried kexec on 3.10.17 kernel, but failed with following log.
I applied the patch you mentioned and another patch which applied before the patch.
Any other things to have a try?
Regards,
Henry.
============================================================================
kexec -d -l ./zImage --dtb ./imx6q-sabresd.dtb --command-line="console=ttymxc0,115200 earlyprintk root=/dev/mmcblk0p2 rootwait rw"
kernel: 0x75df8008 kernel_size: 0x507250
kexec_load: entry = 0x10008000 flags = 0x280000
nr_segments = 2
segment[0].buf = 0x75df8008
segment[0].bufsz = 0x507250
segment[0].mem = 0x10008000
segment[0].memsz = 0x508000
segment[1].buf = 0x1246008
segment[1].bufsz = 0xb8a4
segment[1].mem = 0x1141e000
segment[1].memsz = 0xc000
root@imx6qsabreauto:~/kexec/kernel#
root@imx6qsabreauto:~/kexec/kernel#
root@imx6qsabreauto:~/kexec/kernel# kexec -e
Starting new kernel
Disabling non-boot CPUs ...
CPU1: shutdown
CPU2: shutdown
CPU3: shutdown
Bye!
Hi Henry,
Were you able to verify kexec functionality on 3.14 first?
I have never tried kexec on 3.10, so not sure how easy it will be to find the missing patches.
Regards,
Fabio Estevam
Hi Fabio,
3.14.28 kernel successfully boot by kexec on 3.14.28 kernel. Even I did'nt apply "ARM: 8338/1: kexec: Relax SMP validation to improve DT compatibility"
In case 3.14.28 boot -> kexec -> 3.10.17 kernel didn't boot (stopped at Bye!)
In case 3.10.17 boot -> kexec -> 3.14.28 kernel didn't boot(stopped during kernel booting)
Maybe more patches are required for 3.10 kernel.
Regards,
Henry.
Hi Henry,
I forgot to mention that the "ARM: 8338/1: kexec: Relax SMP validation to improve DT compatibility" is only needed for booting the mx6 solo.
mx6quad and dual-lite boot fine without this patch on 3.14.
Regards,
Fabio Estevam