[PATCH] lib: utils: hsm: Do not fail on EALREADY in rpmi-hsm fixup.

Anup Patel anup at brainfault.org
Sat Jun 14 00:34:33 PDT 2025


On Wed, May 7, 2025 at 2:11 PM Ziang Wang <wangziang.ok at bytedance.com> wrote:
>
> In case harts are divided into groups that use different
> rpmi-hsm channels in different mailboxes, the suspend
> state fixup function will return EALREADY on secondary
> entry, simply skip on this error.
>
> Signed-off-by: Ziang Wang <wangziang.ok at bytedance.com>

LGTM.

Reviewed-by: Anup Patel <anup at brainfault.org>

Applied this patch to the riscv/opensbi repo.

Thanks,
Anup


> ---
>  lib/utils/hsm/fdt_hsm_rpmi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/utils/hsm/fdt_hsm_rpmi.c b/lib/utils/hsm/fdt_hsm_rpmi.c
> index cc78436..09d0c91 100644
> --- a/lib/utils/hsm/fdt_hsm_rpmi.c
> +++ b/lib/utils/hsm/fdt_hsm_rpmi.c
> @@ -330,7 +330,7 @@ skip_suspend_states:
>
>         /* Register HSM fixup callback */
>         rc = fdt_register_general_fixup(&rpmi_hsm_fixup);
> -       if (rc)
> +       if (rc && rc != SBI_EALREADY)
>                 goto fail_free_susp_state_names;
>
>         /* Register HSM device */
> --
> 2.39.5
>
>
> --
> opensbi mailing list
> opensbi at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/opensbi



More information about the opensbi mailing list