[1/1] lib: sbi: Add debug print when sbi_pmu_init fails

Atish Patra atishp at atishpatra.org
Tue Apr 18 22:57:35 PDT 2023


On Fri, Apr 14, 2023 at 10:45 AM Tan En De <ende.tan at starfivetech.com> wrote:
>
> Since sbi_pmu_init is called after sbi_console_init,
> the sbi_printf can be called when sbi_pmu_init fails.
>
> Signed-off-by: Tan En De <ende.tan at starfivetech.com>
> ---
>  lib/sbi/sbi_init.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/lib/sbi/sbi_init.c b/lib/sbi/sbi_init.c
> index a031336..5db8e7f 100644
> --- a/lib/sbi/sbi_init.c
> +++ b/lib/sbi/sbi_init.c
> @@ -290,8 +290,11 @@ static void __noreturn init_coldboot(struct sbi_scratch *scratch, u32 hartid)
>                 sbi_hart_hang();
>
>         rc = sbi_pmu_init(scratch, true);
> -       if (rc)
> +       if (rc) {
> +               sbi_printf("%s: pmu init failed (error %d)\n",
> +                          __func__, rc);
>                 sbi_hart_hang();
> +       }
>
>         sbi_boot_print_banner(scratch);
>
> --
> 2.34.1
>
>
> --
> opensbi mailing list
> opensbi at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/opensbi


Reviewed-by: Atish Patra <atishp at rivosinc.com>

-- 
Regards,
Atish



More information about the opensbi mailing list