From 6a1f53bc2d91310adc44c158596dd1c3efa18080 Mon Sep 17 00:00:00 2001 From: Jesse Taube Date: Mon, 11 Aug 2025 08:29:47 -0700 Subject: [PATCH] dbtr: Fix sbi_dbtr_read_trig to read from CSRs 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: Anup Patel Signed-off-by: Jesse Taube Link: https://lore.kernel.org/r/20250811152947.851208-1-jesse@rivosinc.com Signed-off-by: Anup Patel --- lib/sbi/sbi_dbtr.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/sbi/sbi_dbtr.c b/lib/sbi/sbi_dbtr.c index c30c2fd6..656a6261 100644 --- a/lib/sbi/sbi_dbtr.c +++ b/lib/sbi/sbi_dbtr.c @@ -563,6 +563,10 @@ int sbi_dbtr_read_trig(unsigned long smode, for_each_trig_entry(shmem_base, trig_count, typeof(*entry), entry) { xmit = &entry->data; trig = INDEX_TO_TRIGGER((_idx + trig_idx_base)); + csr_write(CSR_TSELECT, trig->index); + trig->tdata1 = csr_read(CSR_TDATA1); + trig->tdata2 = csr_read(CSR_TDATA2); + trig->tdata3 = csr_read(CSR_TDATA3); xmit->tstate = cpu_to_lle(trig->state); xmit->tdata1 = cpu_to_lle(trig->tdata1); xmit->tdata2 = cpu_to_lle(trig->tdata2);