[PATCH 0/2] [Y/raspi2] [SRU] [Config] BCM2835_WDT=y
Paolo Pisati
paolo.pisati at canonical.com
Wed Jun 7 14:41:00 UTC 2017
BugLink: https://bugs.launchpad.net/bugs/1696436
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.
Paolo Pisati (2):
UBUNTU: [Config] BCM2835_WDT=y
UBUNTU: abi: remove bcm2835_wdt from the modules list
debian.raspi2/abi/4.8.0-1037.40/arm64/raspi2.modules | 1 -
debian.raspi2/abi/4.8.0-1037.40/armhf/raspi2.modules | 1 -
debian.raspi2/config/config.common.ubuntu | 2 +-
3 files changed, 1 insertion(+), 3 deletions(-)
--
2.9.3
More information about the kernel-team
mailing list