Skip to contentSkip to conversation

lib: sbi: fix sse_event_inject() status setting

PATCH Applied Charlie Jenkins 2 participants 2 messages Mar 2 – Mar 10

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lib: sbi: fix sse_event_inject() status setting

sse_event_inject() currently sets all status bits to 1 except for SBI_SSE_ATTR_STATUS_PENDING_OFFSET which it sets to zero. Instead of overwriting all the values of the status bits, sse_event_inject() is only expected to clear SBI_SSE_ATTR_STATUS_PENDING_OFFSET. Fix sse_event_inject() to only do the clearing.

---
 lib/sbi/sbi_sse.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/sbi/sbi_sse.c +1 -1
index a14754f8..818afb87 100644
@@ -548,7 +548,7 @@ static void sse_event_inject(struct sbi_sse_event *e,
 
 	sse_event_set_state(e, SBI_SSE_STATE_RUNNING);
 
-	e->attrs.status = ~BIT(SBI_SSE_ATTR_STATUS_PENDING_OFFSET);
+	e->attrs.status &= ~BIT(SBI_SSE_ATTR_STATUS_PENDING_OFFSET);
 
 	i_ctx->a6 = regs->a6;
 	i_ctx->a7 = regs->a7;

---
base-commit: 8d1c21b38752301fc6c727eece45c15c663649b0
change-id: 20260302-event_inject_fix-d5187be40e0c

- Charlie

Reviewed-by on v1 1/1 Applied
#1 lore raw
Quoted 10 lines · On Tue, Mar 3, 2026 at 4:25 AM Charlie Jenkins via B4 Relay…

From: Charlie Jenkins <[email protected]>

sse_event_inject() currently sets all status bits to 1 except for SBI_SSE_ATTR_STATUS_PENDING_OFFSET which it sets to zero. Instead of overwriting all the values of the status bits, sse_event_inject() is only expected to clear SBI_SSE_ATTR_STATUS_PENDING_OFFSET. Fix sse_event_inject() to only do the clearing.

LGTM.

Applied this patch to the riscv/opensbi repo.

Thanks,
Anup

Quoted 30 lines
---
 lib/sbi/sbi_sse.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/sbi/sbi_sse.c +1 -2
index a14754f8..818afb87 100644
@@ -548,7 +548,7 @@ static void sse_event_inject(struct sbi_sse_event *e,
 
        sse_event_set_state(e, SBI_SSE_STATE_RUNNING);
 
-       e->attrs.status = ~BIT(SBI_SSE_ATTR_STATUS_PENDING_OFFSET);
+       e->attrs.status &= ~BIT(SBI_SSE_ATTR_STATUS_PENDING_OFFSET);
 
        i_ctx->a6 = regs->a6;
        i_ctx->a7 = regs->a7;
 
---

base-commit: 8d1c21b38752301fc6c727eece45c15c663649b0
change-id: 20260302-event_inject_fix-d5187be40e0c

- Charlie

--
opensbi mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/opensbi

Signature · 3 lines
opensbi mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/opensbi