[PATCH] dbtr: Fix sbi_dbtr_read_trig to read from CSRs

Xiang W wxjstz at 126.com
Wed Aug 6 17:14:31 PDT 2025


在 2025-08-06三的 10:10 -0700,Jesse Taube写道:
> sbi_dbtr_read_trig returned the saved state of tdata{1-3}, when it
> should have returned the updated state read from CSRs.
> 
> Update sbi_dbtr_read_trig to return updated state read from CSRs.
> 
> Signed-off-by: Jesse Taube <jesse at rivosinc.com>
> ---
>  lib/sbi/sbi_dbtr.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/lib/sbi/sbi_dbtr.c b/lib/sbi/sbi_dbtr.c
> index a832c7f1..a39c3164 100644
> --- a/lib/sbi/sbi_dbtr.c
> +++ b/lib/sbi/sbi_dbtr.c
> @@ -529,9 +529,9 @@ int sbi_dbtr_read_trig(unsigned long smode,
>  		xmit = &entry->data;
>  		trig = INDEX_TO_TRIGGER((_idx + trig_idx_base));
>  		xmit->tstate = cpu_to_lle(trig->state);
> -		xmit->tdata1 = cpu_to_lle(trig->tdata1);
> -		xmit->tdata2 = cpu_to_lle(trig->tdata2);
> -		xmit->tdata3 = cpu_to_lle(trig->tdata3);
> +		xmit->tdata1 = csr_read(CSR_TDATA1);
> +		xmit->tdata2 = csr_read(CSR_TDATA2);
> +		xmit->tdata3 = csr_read(CSR_TDATA1);

the debug trigger state and configuration consisting of four XLEN-bit 
words are written in little-endian format

Do not remove cpu_to_lle.

Regards,
Xiang W
>  	}
>  	sbi_hart_unmap_saddr();
>  
> -- 
> 2.43.0
> 




More information about the opensbi mailing list