[PATCH v4 3/4] firmware: raspberrypi: Add reboot mode support
Stefan Wahren
wahrenst at gmx.net
Fri Sep 4 09:39:52 PDT 2026
Am 04.09.26 um 09:46 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>
Tested-by: Stefan Wahren <wahrenst at gmx.net>
I tested with a Raspberry Pi 3 B Plus i didn't see any regressions
also the code looks fine to me
More information about the linux-arm-kernel
mailing list