Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Fiona Klute via buildroot <buildroot@buildroot.org>
To: "José Mendes" <jp.baltazar.mendes@gmail.com>, buildroot@buildroot.org
Subject: Re: [Buildroot] RaspberryPi U-Boot watchdog
Date: Wed, 24 Jul 2024 12:58:00 +0200	[thread overview]
Message-ID: <475db7e5-b2e8-40e9-9547-73b545a33509@gmx.de> (raw)
In-Reply-To: <CAFAK9+cph-594kM4jz+4zYV3zTkQZa22o9OwQpsaFBrCrL598g@mail.gmail.com>

Hi José!

Am 24.07.24 um 12:16 schrieb José Mendes:
> Hi all,
>
> I'm trying to build a system with redundant rootfs partitions for a
> Raspberry Pi 4 with U-Boot.
>
> I'm trying to test the recovery of this system but I can't seem to get the
> raspberry pi to reset after a kernel panic on a non-working rootfs.
>
> To provoke this kernel panic I am simply deleting all the files in the
> particular rootfs. The system seems to just hang there after the panic:
>
> .....
> [    3.374273] Kernel panic - not syncing: No working init found.  Try
> passing init= option to kernel. See Linux
> Documentation/admin-guide/init.rst for guidance.
> [    3.388444] CPU: 3 PID: 1 Comm: swapper/0 Not tainted 6.1.61-v8 #2
> [    3.394627] Hardware name: Raspberry Pi 4 Model B Rev 1.5 (DT)
> [    3.400456] Call trace:
> [    3.402897]  dump_backtrace.part.0+0xe8/0x100
> [    3.407264]  show_stack+0x20/0x30
> [    3.410579]  dump_stack_lvl+0x88/0xb4
> [    3.414246]  dump_stack+0x18/0x34
> [    3.417561]  panic+0x1a0/0x370
> [    3.420618]  kernel_init+0x138/0x140
> [    3.424197]  ret_from_fork+0x10/0x20
> [    3.427776] SMP: stopping secondary CPUs
> [    3.431701] Kernel Offset: 0x1353c00000 from 0xffffffc008000000
> [    3.437617] PHYS_OFFSET: 0x0
> [    3.440492] CPU features: 0x80000,2013c080,0000421b
> [    3.445368] Memory Limit: none
> [    3.448423] ---[ end Kernel panic - not syncing: No working init found.
> Try passing init= option to kernel. See Linux
> Documentation/admin-guide/init.rst for guidance. ]---
>
> What I've tried:
> - From `Target packages`: watchdog, watchdogd
> - Busybox watchdog
> - From linux-menuconfig > device drivers > watchdog
> - From uboot-menuconfig > device drivers > watchdog
>
> None of these seem to be working for me.

The config options in menuconfig (both for U-Boot and Linux) only enable
the drivers to support the watchdog. The kernel can handle watchdogs
internally (see CONFIG_WATCHDOG_HANDLE_BOOT_ENABLED and
CONFIG_WATCHDOG_OPEN_TIMEOUT in the kernel config), but generally you
want that only as a transitory thing during boot before a watchdog
service (whether watchdogd or Busybox watchdog) takes over.

If you want the watchdog to reset no matter how broken the kernel or
userspace may be, enable the watchdog in U-Boot *before* starting the
kernel using the "wdt" command:
https://docs.u-boot.org/en/latest/usage/cmd/wdt.html

Excerpt from my boot.scr that configures the watchdog of an RPi CM4 (so,
the device may be different for you, and you need the matching driver
enabled in the U-Boot config) to expect a pet every 15 seconds:

wdt dev watchdog@7e100000
wdt start 15000

Of course the system then needs to boot up far enough to handle the
watchdog before that time is over.

Best regards,
Fiona

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  parent reply	other threads:[~2024-07-24 10:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-24 10:16 [Buildroot] RaspberryPi U-Boot watchdog José Mendes
2024-07-24 10:38 ` Waldemar Brodkorb
2024-07-24 10:58 ` Fiona Klute via buildroot [this message]
2024-07-24 14:59   ` José Mendes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=475db7e5-b2e8-40e9-9547-73b545a33509@gmx.de \
    --to=buildroot@buildroot.org \
    --cc=fiona.klute@gmx.de \
    --cc=jp.baltazar.mendes@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox