Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 May 2023 04:05:19 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-arm@FreeBSD.org
Subject:   [Bug 271359] RPi4: reset after shutdown -h doesn't work.
Message-ID:  <bug-271359-7@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D271359

            Bug ID: 271359
           Summary: RPi4: reset after shutdown -h doesn't work.
           Product: Base System
           Version: 13.2-STABLE
          Hardware: arm64
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: arm
          Assignee: freebsd-arm@FreeBSD.org
          Reporter: t_uemura@macome.co.jp

Created attachment 242116
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D242116&action=
=3Dedit
Ugly but reliable way of workaround.

On RPi4B running 13.2-RELEASE official image (or home-brew 13.2-STABLE with
more recent u-boot and firmware), reset after shutdown -h by pressing a key=
 to
"The operating system has halted.\nPlease press any key to reboot." prompt
never works as expected. It simply freezes just after "Rebooting..." messag=
e,
and a power cycle is required to restart the operating system.

Precisely, reset after shutdown -h is handled by
sys/kern/kern_shutdown.c:shutdown_reset() but there are two hardware specif=
ic
issues here.=20

The one is that mtx_lock_spin(&smp_ipi_mtx) never returns. I don't know how
important this lock is and tried to see by commenting it out, and faced ano=
ther
issue.

If I omitted the lock, then psci_call(PSCI_FNID_SYSTEM_RESET) was subsequen=
tly
called from cpu_lock() and it never successfully reset the board. Just stop.
Screen was still on and "Rebooting..." was intact. I don't know whether this
psci_call() failure is caused by the skipped lock.

To workaround, a watchdog firing is good alternative, as did in
sys/arm/broadcom/bcm2835/bcm2835_wdog.c:bcmwd_reboot_system().

I was very reluctant to add machine-dependent code to the file under sys/ke=
rn,
but I couldn't think of any other way to get around the lock other than what
was did in the attached patch.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-271359-7>