Skip to contentSkip to conversation

lib: sbi: sse: fix invalid errors returned for sse_hart_mask/unmask()

PATCH New Clément Léger 3 participants 3 messages Feb 13, 2025 – Feb 19, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lib: sbi: sse: fix invalid errors returned for sse_hart_mask/unmask()

When called twice, sse_hart_mask()/sse_hart_unmask() should return SBI_EALREADY_STOPPED/SBI_EALREADY_STARTED. This was currently inverted.

Fixes b919daf49582 ("lib: sbi: Add support to mask/unmask SSE events")
---
 lib/sbi/sbi_sse.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
lib/sbi/sbi_sse.c +2 -2
index 9f22375f..2f9bdef8 100644
@@ -882,7 +882,7 @@ int sbi_sse_hart_mask(void)
 		return SBI_EFAIL;
 
 	if (state->masked)
-		return SBI_EALREADY_STARTED;
+		return SBI_EALREADY_STOPPED;
 
 	state->masked = true;
 
@@ -897,7 +897,7 @@ int sbi_sse_hart_unmask(void)
 		return SBI_EFAIL;
 
 	if (!state->masked)
-		return SBI_EALREADY_STOPPED;
+		return SBI_EALREADY_STARTED;
 
 	state->masked = false;
 
Signature · 1 line
2.47.2
#1 lore raw

PATCH 1/1 lib: sbi: sse: fix invalid errors returned for sse_hart_mask/unmask()

Quoted 9 lines · Cl?ment L?ger

When called twice, sse_hart_mask()/sse_hart_unmask() should return SBI_EALREADY_STOPPED/SBI_EALREADY_STARTED. This was currently inverted.

Fixes b919daf49582 ("lib: sbi: Add support to mask/unmask SSE events")
---
 lib/sbi/sbi_sse.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Applied
#2 lore raw

PATCH 1/1 lib: sbi: sse: fix invalid errors returned for sse_hart_mask/unmask()

In reply to Clément Léger
Quoted 7 lines · On Thu, Feb 13, 2025 at 3:01?PM Cl?ment L?ger <[email protected]> wrote:

When called twice, sse_hart_mask()/sse_hart_unmask() should return SBI_EALREADY_STOPPED/SBI_EALREADY_STARTED. This was currently inverted.

Fixes b919daf49582 ("lib: sbi: Add support to mask/unmask SSE events")

LGTM.

Applied this patch to the riscv/opensbi repo.

Thanks,
Anup

Quoted 34 lines
---
 lib/sbi/sbi_sse.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
lib/sbi/sbi_sse.c +2 -3
index 9f22375f..2f9bdef8 100644
@@ -882,7 +882,7 @@ int sbi_sse_hart_mask(void)
                return SBI_EFAIL;
 
        if (state->masked)
-               return SBI_EALREADY_STARTED;
+               return SBI_EALREADY_STOPPED;
 
        state->masked = true;
 
@@ -897,7 +897,7 @@ int sbi_sse_hart_unmask(void)
                return SBI_EFAIL;
 
        if (!state->masked)
-               return SBI_EALREADY_STOPPED;
+               return SBI_EALREADY_STARTED;
 
        state->masked = false;
 
--

2.47.2

--
opensbi mailing list
opensbi at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/opensbi