[PATCH RESEND v3 3/4] firmware: raspberrypi: Add reboot mode support

Stefan Wahren wahrenst at gmx.net
Thu Sep 3 11:08:22 PDT 2026


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 ?

Best regards



More information about the linux-arm-kernel mailing list