[PATCH 1/1] lib: utils/reset: error handling in fdt_reset_init()
Alexandre Ghiti
alexandre.ghiti at canonical.com
Tue Oct 26 02:29:14 PDT 2021
On Tue, Oct 26, 2021 at 10:25 AM Heinrich Schuchardt
<heinrich.schuchardt at canonical.com> wrote:
>
> The initialization of a reset driver may fail for various reasons, like
> a PMIC based reset driver not finding the required I2C driver. The return
> code of the init routine may take other error values than -ENODEV.
>
> If the initialization of a reset driver fails, this should not lead to the
> board hanging. It is enough that the reset driver does not call
> sbi_system_reset_add_device() to avoid invoking the driver for a device
> that could not be initialized.
>
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt at canonical.com>
> ---
> lib/utils/reset/fdt_reset.c | 9 +++++----
> 1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/lib/utils/reset/fdt_reset.c b/lib/utils/reset/fdt_reset.c
> index 92f37b0..e1d6fdc 100644
> --- a/lib/utils/reset/fdt_reset.c
> +++ b/lib/utils/reset/fdt_reset.c
> @@ -46,10 +46,11 @@ int fdt_reset_init(void)
>
> if (drv->init) {
> rc = drv->init(fdt, noff, match);
> - if (rc == SBI_ENODEV)
> - continue;
> - if (rc)
> - return rc;
> + /*
> + * The driver will not call
> + * sbi_system_reset_add_device() in case of an error.
> + * Hence any error shall be ignored here.
> + */
> }
> }
Agreed, IMO a reset driver failure is not enough to make the whole
boot process hang.
>
> --
> 2.32.0
>
More information about the opensbi
mailing list