[PATCH v2 2/3] lib: sbi: report smrnmi_handlers_init failures instead of ignoring them

Nia Su nia.su at sifive.com
Fri Sep 11 01:29:14 PDT 2026


On Fri, Sep 11, 2026 at 2:56 AM Evgeny Voevodin
<evvoevod at tenstorrent.com> wrote:
>
> Code looks good to me.
>
> Please, add a note about assumed SBI_E* return value on error in
> sbi_platform.h where you change the return type of smrnmi_handlers_init:
>
>       Returns SBI_OK on success, error code otherwise.
>
> Note that comment for rnmi_handler below which says returns SBI_SUCCESS
> is not precise. SBI_SUCCESS comes from sbi_ecall_interface.h and it is a
> return value of the SBI call, while this callback is called by the
> firmware itself and its result never goes to S-mode. sbi_error.h has
> SBI_OK for that and the value is the same 0. Maybe worth changing it to
> SBI_OK in the same commit or sending as a separate trivial fix.

I think fixing this in the same commit is fine. This ensures that both
callbacks consistently use the same, correct firmware-internal success
constant, rather than the ecall-facing one. I’ll adopt these suggestions in
the next revision.

Thanks,
Nia

> Reviewed-by: Evgeny Voevodin <evvoevod at tenstorrent.com>
>
>   Thanks,
>   Evgeny



More information about the opensbi mailing list