Public bug reported:

[Impact]
The 'reboot' command doesn't work in the arm64 variant of the raspi2 kernel: 
after issuing 'reboot' the board starts the reboot process, reaches its end and 
prints '[  451.761674] reboot: Restarting system' but then it sits there 
forever - the only way to reboot the board is to phisically pull the plug. It 
only affects Yakkety.

After some investigation i found what's going on: the reboot process for
the armhf and arm64 variants of the raspi2 kernel is significanly
different, even if it uses the same hardware mechanism.

On armhf, in the board code (arch/arm/mach-
bcm2709/bcm2709.c::bcm2709_restart()) that is executed early during
boot, bcm2709_restart() is registered as the restart callback in the
board data structure, and whenever we execute 'reboot' the function is
called: it directly initializes the watchdog hardware with a very short
timeout, kicks it and then sits there waiting for the timer to expire
(and the watchdog to reboot the board)

For arm64, on the other hard, there's no board code (the board code is a
relic from the pre-dt period and when arm64 was started they went DT
only from the get go), so there isn't a board structure containing
custom functions for every board (init board call back, post init
callback, restart call back, etc), instead the arm64 reboot code
(arch/arm64/kernel/process.c::machine_restart()) invokes the generic
reboot code (kernel/reboot.c::do_kernel_restart()) which in turn walks
and invokes, every reboot handler that was registered on the
restart_handler_list (kernel/reboot::restart_handler_list) - in other
words, it relies on another piece of code (able to reset the board) to
register its reboot function on that handler list and then it uses it.
In the raspberry board, the hardware capable of rebooting the board is
the hardware watchdog (that among the other things register a reboot
handler once it attaches), but on Y/arm64 the kernel driver for such
hardware was built as a module and it doesn't autoload on boot, so
restart_handler_list results empy when 'reboot' is invoked.

[Fix]
Built-in the watchdog driver (CONFIG_BCM2835_WDT).

[Test case]
Try to execute 'reboot' on Y/arm64 and watch the board sits at the 'Restarting 
system', then install a kernel with the watchdog driver built-in and execute 
reboot again.

** Affects: linux-raspi2 (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1696436

Title:
  arm64: 'reboot' doesn't work, needs to pull the plug

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux-raspi2/+bug/1696436/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to