[PATCH RESEND v3 3/4] firmware: raspberrypi: Add reboot mode support
Gregor Herburger
gregor.herburger at linutronix.de
Thu Sep 3 13:31:48 PDT 2026
On Thu, Sep 03, 2026 at 08:08:22PM +0200, Stefan Wahren wrote:
> Hi Gregor,
>
> Am 03.09.26 um 16:48 schrieb Gregor Herburger:
> > The Raspberry Pi firmware has a tryboot mode where it tries to boot from
> > another partition. This can be used to create a A/B update scheme.
> >
> > To enable this on the next boot, the RPI_FIRMWARE_SET_REBOOT_FLAGS
> > message must be sent to the firmware. Add support for this by
> > registering a reboot mode driver.
> >
> > Furthermore, safely registering the reboot mode requires adjusting the
> > teardown sequence. Replace the manually called rpi_firmware_put() with a
> > devres-managed called (devm_add_action_or_reset). Without this, the
> > cleanup function of devm_reboot_mode_register() would trigger a
> > use-after-free error by attempting to access the firmware context after
> > it had already been freed by rpi_firmware_remove().
> >
> > Signed-off-by: Gregor Herburger <gregor.herburger at linutronix.de>
> > ---
> > drivers/firmware/Kconfig | 2 ++
> > drivers/firmware/raspberrypi.c | 40 ++++++++++++++++++++++++++----
> > include/soc/bcm2835/raspberrypi-firmware.h | 2 ++
> > 3 files changed, 39 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/firmware/Kconfig b/drivers/firmware/Kconfig
> > index bbd2155d84838..34605bf7c9734 100644
> > --- a/drivers/firmware/Kconfig
> > +++ b/drivers/firmware/Kconfig
> > @@ -115,6 +115,8 @@ config ISCSI_IBFT
> > config RASPBERRYPI_FIRMWARE
> > tristate "Raspberry Pi Firmware Driver"
> > depends on BCM2835_MBOX
> > + select POWER_RESET
> > + select REBOOT_MODE
> > help
> > This option enables support for communicating with the firmware on the
> > Raspberry Pi.
> >
> this part doesn't apply anymore. Did you rebased against 7.3-rc1 ?
I have not rebased. I just sent the series out again to get some feedback. I
will rebase it and send it again. Sashiko found an issue anyways.
>
> Best regards
Best regards
--
Gregor Herburger
Linutronix GmbH | Bahnhofstrasse 3 | D-88690 Uhldingen-Mühlhofen
Phone: +49 7556 25 999 35; Fax.: +49 7556 25 999 99
Hinweise zum Datenschutz finden Sie hier (Informations on data privacy
can be found here): https://linutronix.de/legal/data-protection.php
Linutronix GmbH | Firmensitz (Registered Office): Uhldingen-Mühlhofen |
Registergericht (Registration Court): Amtsgericht Freiburg i.Br., HRB700
806 | Geschäftsführer (Managing Directors): Dr. Wilfried Wessner,
Katharina Kopp, Alexander Gieringer
More information about the linux-arm-kernel
mailing list