From: "David E. Garcia Porras" <david.garcia@aheadcomputing.com>
To: opensbi@lists.infradead.org
Cc: Anup Patel <anup@brainfault.org>,
Nicholas Piggin <npiggin@gmail.com>,
Himanshu Chauhan <hchauhan@ventanamicro.com>,
"David E. Garcia Porras" <david.garcia@aheadcomputing.com>
Subject: [PATCH 2/3] lib: sbi: dbtr: return SBI_ERR_BAD_RANGE for invalid trigger index range
Date: Mon, 27 Jul 2026 12:30:40 -0600 [thread overview]
Message-ID: <20260727183041.258377-3-david.garcia@aheadcomputing.com> (raw)
In-Reply-To: <20260727183041.258377-1-david.garcia@aheadcomputing.com>
sbi_dbtr_read_trig() returns SBI_ERR_INVALID_PARAM for an out-of-range
trigger index range, where SBI v3.0 section 19.3 defines
SBI_ERR_BAD_RANGE. Return SBI_ERR_BAD_RANGE, matching the equivalent
range check in sbi_dbtr_update_trig().
Fixes: 324021423d06 ("lib: sbi: dbtr: Fix update_triggers to match SBI")
Signed-off-by: David E. Garcia Porras <david.garcia@aheadcomputing.com>
---
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 a04f367d..d06fcaeb 100644
--- a/lib/sbi/sbi_dbtr.c
+++ b/lib/sbi/sbi_dbtr.c
@@ -650,7 +650,7 @@ int sbi_dbtr_read_trig(unsigned long smode,
if (trig_idx_base >= hs->total_trigs ||
trig_idx_base + trig_count >= hs->total_trigs)
- return SBI_ERR_INVALID_PARAM;
+ return SBI_ERR_BAD_RANGE;
if (sbi_dbtr_shmem_disabled(hs))
return SBI_ERR_NO_SHMEM;
--
2.43.0
--
opensbi mailing list
opensbi@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/opensbi
next prev parent reply other threads:[~2026-07-27 18:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-27 18:30 [PATCH 0/3] lib: sbi: dbtr: per-slot trigger capability detection David E. Garcia Porras
2026-07-27 18:30 ` [PATCH 1/3] lib: sbi: dbtr: add platform device for per-slot trigger capabilities David E. Garcia Porras
2026-07-27 18:30 ` David E. Garcia Porras [this message]
2026-07-27 18:30 ` [PATCH 3/3] lib: sbi: dbtr: return SBI_ERR_INVALID_PARAM for invalid trigger configuration David E. Garcia Porras
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260727183041.258377-3-david.garcia@aheadcomputing.com \
--to=david.garcia@aheadcomputing.com \
--cc=anup@brainfault.org \
--cc=hchauhan@ventanamicro.com \
--cc=npiggin@gmail.com \
--cc=opensbi@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).