mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2025-08-25 15:51:41 +01:00
lib: sbi: Put event after use in sbi_sse_exit() loop
Currently, the sbi_sse_exit() gets event in a loop but does not put
it back after use. This results in global events remaining locked
causing hangs on sub-sequent calls to sse_event_get() for global
events.
Fixes: c8cdf01d8f
("lib: sbi: Add support for Supervisor Software Events extension")
Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Reviewed-by: Himanshu Chauhan <hchauhan@ventanamicro.com>
This commit is contained in:
@@ -1121,13 +1121,18 @@ void sbi_sse_exit(struct sbi_scratch *scratch)
|
|||||||
|
|
||||||
for (i = 0; i < EVENT_COUNT; i++) {
|
for (i = 0; i < EVENT_COUNT; i++) {
|
||||||
e = sse_event_get(supported_events[i]);
|
e = sse_event_get(supported_events[i]);
|
||||||
|
if (!e)
|
||||||
if (!e || e->attrs.hartid != current_hartid())
|
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if (e->attrs.hartid != current_hartid())
|
||||||
|
goto skip;
|
||||||
|
|
||||||
if (sse_event_state(e) > SBI_SSE_STATE_REGISTERED) {
|
if (sse_event_state(e) > SBI_SSE_STATE_REGISTERED) {
|
||||||
sbi_printf("Event %d in invalid state at exit", i);
|
sbi_printf("Event %d in invalid state at exit", i);
|
||||||
sse_event_set_state(e, SBI_SSE_STATE_UNUSED);
|
sse_event_set_state(e, SBI_SSE_STATE_UNUSED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
skip:
|
||||||
|
sse_event_put(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user