Re: [PATCH v21 03/13] power: reset: reboot-mode: Add support for predefined reboot modes

Bartosz Golaszewski
2026-04-28T07:46:54Z

On Mon, 27 Apr 2026 19:34:43 +0200, Shivendra Pratap
<shivendra.pratap@oss.qualcomm.com> said:
> reboot-mode based drivers can define a reboot-mode by adding it under
> the reboot-mode node in device tree. This limits such drivers, to define
> any predefined reboot-modes statically within the driver and creates a
> dependency on device-tree.
>
> Introduce a list for predefined modes in the reboot-mode framework and
> process the predefined reboot-modes along with the device-tree defined
> reboot-modes. Modify existing reboot-mode based drivers to initialize
> the predefined list-head as empty.
>
> This patch enables a reboot mode driver to define reboot-modes through a
> predefined static list, in addition to the device-tree based reboot-modes.
>
> Signed-off-by: Shivendra Pratap <shivendra.pratap@oss.qualcomm.com>
> ---
> drivers/power/reset/nvmem-reboot-mode.c | 1 +
> drivers/power/reset/qcom-pon.c | 1 +
> drivers/power/reset/reboot-mode.c | 66 ++++++++++++++++++++------------
> drivers/power/reset/syscon-reboot-mode.c | 1 +
> include/linux/reboot-mode.h | 8 ++++
> 5 files changed, 52 insertions(+), 25 deletions(-)
>
> diff --git a/drivers/power/reset/nvmem-reboot-mode.c b/drivers/power/reset/nvmem-reboot-mode.c
> index bd05d660490c686b43134f82f1eadd7665403d20..83a8d80fd7d1ccb1b736aee5f2d675246a63b8f8 100644
> --- a/drivers/power/reset/nvmem-reboot-mode.c
> +++ b/drivers/power/reset/nvmem-reboot-mode.c
> @@ -53,6 +53,7 @@ static int nvmem_reboot_mode_probe(struct platform_device *pdev)
>
> nvmem_rbm->reboot.dev = &pdev->dev;
> nvmem_rbm->reboot.write = nvmem_reboot_mode_write;
> + INIT_LIST_HEAD(&nvmem_rbm->reboot.predefined_modes);
>
> nvmem_rbm->cell = devm_nvmem_cell_get(&pdev->dev, "reboot-mode");
> if (IS_ERR(nvmem_rbm->cell)) {
> diff --git a/drivers/power/reset/qcom-pon.c b/drivers/power/reset/qcom-pon.c
> index 57b36e6186f80aff947fd7f5aae5ce280c65dc6b..9d0e3fc621a6173438c6da4cce38394199451881 100644
> --- a/drivers/power/reset/qcom-pon.c
> +++ b/drivers/power/reset/qcom-pon.c
> @@ -73,6 +73,7 @@ static int qcom_pon_probe(struct platform_device *pdev)
> pon->reboot_mode.dev = &pdev->dev;
> pon->reason_shift = reason_shift;
> pon->reboot_mode.write = qcom_pon_reboot_mode_write;
> + INIT_LIST_HEAD(&pon->reboot_mode.predefined_modes);

Maybe unrelated to this series but we could use some centralized initializer
for struct reboot_mode_driver as well as rename it to struct reboot_mode_device
which it actually is.

For now:

Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>

Bart