Skip to contentSkip to conversation

reboot fails on at91sam9g20 with kernel 4.x

DISCUSSION Alexander Dahl 2 participants 3 messages Nov 23, 2016 – Nov 24, 2016

lore
Share & tools
lore
#0 lore raw

Hei hei,

while upgrading a at91sam9g20 based board to a recent kernel I stumbled over a problem I can not solve by myself. We have a board which is more or less a stripped down version of the at91sam9g20ek. The kernels I was trying lately with a custom DT were 3.14.79, 3.18.44 (didn't work), 4.4.32, 4.8.6 and 4.9-rc6+. The rootfs is built with OSELAS.Toolchain-2014.12.2, ptxdist 2016.11.0, gcc 4.9.2, glibc 2.20, busybox v1.24.2 and it's on a UBIFS on NAND flash.

The following happens if I try to reboot a 4.x kernel from console:

The system is going down NOW!
Sent SIGTERM to all processes
macb fffc4000.ethernet eth0: link down
Requesting system reboot
reboot: Restarting system
Reboot failed -- System halted

The last message obviously comes from arch/arm/kernel/reboot.c and something fails. ;-)

Searching the web I found someone having a similar problem here:

https://groups.google.com/forum/#!topic/acmesystems/vC_66zmcatk

Reboot works with 3.x kernels (if they run at all). I'll try a 4.1 tomorrow, but I would be happy if someone could assist me in debugging this.

Greets
Alex

#1 lore raw

Hi,

Quoted 11 lines · Alexander Dahl

The last message obviously comes from arch/arm/kernel/reboot.c and something fails. ;-)

Searching the web I found someone having a similar problem here:

https://groups.google.com/forum/#!topic/acmesystems/vC_66zmcatk

Reboot works with 3.x kernels (if they run at all). I'll try a 4.1 tomorrow, but I would be happy if someone could assist me in debugging this.

Since 3.18, the shdwc and reset controller have their own drivers that may or may not be compiled in the kernel. Can you check you have CONFIG_POWER_RESET_AT91_POWEROFF and CONFIG_POWER_RESET_AT91_RESET set in your configuration? Also, you probably want to check the DT definition of the shdwc and the rstc.

Regards,

Signature · 3 lines
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
#2 lore raw

Hei hei,

Am Mittwoch, 23. November 2016, 23:11:21 schrieb Alexandre Belloni:

Quoted 5 lines

Since 3.18, the shdwc and reset controller have their own drivers that may or may not be compiled in the kernel. Can you check you have CONFIG_POWER_RESET_AT91_POWEROFF and CONFIG_POWER_RESET_AT91_RESET set in your configuration? Also, you probably want to check the DT definition of the shdwc and the rstc.

You were right, those were not set.

-# CONFIG_POWER_RESET is not set
+CONFIG_POWER_RESET=y
+CONFIG_POWER_RESET_AT91_POWEROFF=y
+CONFIG_POWER_RESET_AT91_RESET=y

With the above change in the kernel config the board reboots fine.

I'm not quite sure anymore how I got to my kernelconfig, maybe based on a pre 3.18 config without going through oldconfig.

I double checked the at91_dt_defconfig from 4.8.10 now and it activates those options, maybe I should have done this in the first place.

So thank you very much for your hint. :-)

Greets
Alex

Signature · 9 lines
------------------------------------------------------------------------
Thorsis Technologies GmbH                     Tel.: +49-391-544 563-3036
Oststra?e 18                                  Fax.: +49-391-544 563-9099
39114 Magdeburg                                  http://www.thorsis.com/

Sitz der Gesellschaft: Magdeburg
Amtsgericht Stendal HRB 110339
Gesch?ftsf?hrer: Dipl.-Ing. Thorsten Szczepanski
------------------------------------------------------------------------