[PATCH] lib: sbi: skip wait_for_coldboot when coolboot done

Anup Patel apatel at ventanamicro.com
Sat Dec 9 22:19:33 PST 2023


On Wed, Nov 29, 2023 at 7:27 PM Xiang W <wxjstz at 126.com> wrote:
>
> When warmboot via HSM, coolboot has been completed and
> wait_for_coldboot can be skipped to speed up.
>
> Signed-off-by: Xiang W <wxjstz at 126.com>
> ---
>  lib/sbi/sbi_init.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/lib/sbi/sbi_init.c b/lib/sbi/sbi_init.c
> index e723553..1f7f522 100644
> --- a/lib/sbi/sbi_init.c
> +++ b/lib/sbi/sbi_init.c
> @@ -492,7 +492,8 @@ static void __noreturn init_warmboot(struct sbi_scratch *scratch, u32 hartid)
>  {
>         int hstate;
>
> -       wait_for_coldboot(scratch, hartid);
> +       if (!__smp_load_acquire(&coldboot_done))
> +               wait_for_coldboot(scratch, hartid);

Better to have this check at the start of wait_for_coldboot()
implementation.

>
>         hstate = sbi_hsm_hart_get_state(sbi_domain_thishart_ptr(), hartid);
>         if (hstate < 0)
> --
> 2.42.0
>
>
> --
> opensbi mailing list
> opensbi at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/opensbi

Regards,
Anup



More information about the opensbi mailing list