[PATCH 3/3] lib: sbi: dbtr: return SBI_ERR_INVALID_PARAM for invalid trigger configuration

Anup Patel anup at brainfault.org
Mon Aug 31 08:46:30 PDT 2026


On Tue, Jul 28, 2026 at 12:00 AM David E. Garcia Porras
<david.garcia at aheadcomputing.com> wrote:
>
> sbi_dbtr_install_trig() returns the generic SBI_ERR_FAILED when
> dbtr_trigger_valid() rejects a trigger configuration (dmode or M-mode
> bits set), where SBI v3.0 section 19.4 defines SBI_ERR_INVALID_PARAM
> for an invalid trigger configuration entry. Return
> SBI_ERR_INVALID_PARAM instead.
>
> Fixes: 97f234f15c96 ("lib: sbi: Introduce the SBI debug triggers extension support")
> Signed-off-by: David E. Garcia Porras <david.garcia at aheadcomputing.com>

LGTM.

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

Applied this patch to the riscv/opensbi repo.

Thanks,
Anup

> ---
>  lib/sbi/sbi_dbtr.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/sbi/sbi_dbtr.c b/lib/sbi/sbi_dbtr.c
> index d06fcaeb..4fd7fb5e 100644
> --- a/lib/sbi/sbi_dbtr.c
> +++ b/lib/sbi/sbi_dbtr.c
> @@ -729,7 +729,7 @@ int sbi_dbtr_install_trig(unsigned long smode,
>                         *out = _idx;
>                         sbi_hart_protection_unmap_range((unsigned long)shmem_base,
>                                                         trig_count * sizeof(*entry));
> -                       return SBI_ERR_FAILED;
> +                       return SBI_ERR_INVALID_PARAM;
>                 }
>
>                 if ((recv->tdata2 && !tdata2_impl) ||
> --
> 2.43.0
>



More information about the opensbi mailing list