[PATCH] lib: sbi: sse: fix invalid errors returned for sse_hart_mask/unmask()

Anup Patel anup at brainfault.org
Wed Feb 19 03:45:33 PST 2025


On Thu, Feb 13, 2025 at 3:01 PM Clément Léger <cleger at rivosinc.com> wrote:
>
> When called twice, sse_hart_mask()/sse_hart_unmask() should return
> SBI_EALREADY_STOPPED/SBI_EALREADY_STARTED. This was currently inverted.
>
> Fixes: b919daf49582 ("lib: sbi: Add support to mask/unmask SSE events")
> Reported-by: Andrew Jones <ajones at ventanamicro.com>
> Signed-off-by: Clément Léger <cleger at rivosinc.com>

LGTM.

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

Applied this patch to the riscv/opensbi repo.

Thanks,
Anup

> ---
>  lib/sbi/sbi_sse.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/lib/sbi/sbi_sse.c b/lib/sbi/sbi_sse.c
> index 9f22375f..2f9bdef8 100644
> --- a/lib/sbi/sbi_sse.c
> +++ b/lib/sbi/sbi_sse.c
> @@ -882,7 +882,7 @@ int sbi_sse_hart_mask(void)
>                 return SBI_EFAIL;
>
>         if (state->masked)
> -               return SBI_EALREADY_STARTED;
> +               return SBI_EALREADY_STOPPED;
>
>         state->masked = true;
>
> @@ -897,7 +897,7 @@ int sbi_sse_hart_unmask(void)
>                 return SBI_EFAIL;
>
>         if (!state->masked)
> -               return SBI_EALREADY_STOPPED;
> +               return SBI_EALREADY_STARTED;
>
>         state->masked = false;
>
> --
> 2.47.2
>
>
> --
> opensbi mailing list
> opensbi at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/opensbi



More information about the opensbi mailing list