[PATCH] lib: utils: hsm: Do not fail on EALREADY in rpmi-hsm fixup.
王子昂
wangziang.ok at bytedance.com
Mon May 12 00:30:05 PDT 2025
Hi all,
I would like to hear your feedback on this.
It is common to have harts grouped by different mailboxes on a multi-socket system. The current HSM implementation can actually suffice this case, with the only minor change in this patch. We have tested it on both QEMU virt machine and our RISC-V project.
Best Regards,
Ziang
> From: "Ziang Wang"<wangziang.ok at bytedance.com>
> Date: Wed, May 7, 2025, 15:46
> Subject: [PATCH] lib: utils: hsm: Do not fail on EALREADY in rpmi-hsm fixup.
> To: <opensbi at lists.infradead.org>
> Cc: "Ziang Wang"<wangziang.ok at bytedance.com>
> 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>
> ---
> 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
>
More information about the opensbi
mailing list