diff options
| author | Clément Léger <[email protected]> | 2024-04-09 12:02:06 +0200 |
|---|---|---|
| committer | Anup Patel <[email protected]> | 2024-05-07 17:28:44 +0530 |
| commit | ce3c82cb2e2d6e41912b97c4f99e8567fadf445e (patch) | |
| tree | 7165773e71c2f2ea9fe8c825a984a53396c8b7ff | |
| parent | d528dbfd4ba674dabb0a7b4466112e64c6ada3c6 (diff) | |
lib: sbi: sse: call enable callback before sending IPI
Move the enable callback call before sending the IPI. Even though the
event is locked and no race condition can happen, this is more logical.
Signed-off-by: Clément Léger <[email protected]>
Reported-by: Samuel Holland <[email protected]>
Reviewed-by: Anup Patel <[email protected]>
| -rw-r--r-- | lib/sbi/sbi_sse.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/sbi/sbi_sse.c b/lib/sbi/sbi_sse.c index 2c7f78d2..fb327f02 100644 --- a/lib/sbi/sbi_sse.c +++ b/lib/sbi/sbi_sse.c @@ -686,12 +686,12 @@ static int sse_event_enable(struct sbi_sse_event *e) sse_event_set_state(e, SBI_SSE_STATE_ENABLED); sse_event_add_to_list(e); - if (sse_event_pending(e)) + sse_event_invoke_cb(e, enable_cb); + + if (sse_event_is_global(e) && sse_event_pending(e)) sbi_ipi_send_many(1, e->attrs.hartid, sse_ipi_inject_event, NULL); - sse_event_invoke_cb(e, enable_cb); - return SBI_OK; } |
