Commit 611eb9cf authored by Jeenu Viswambharan's avatar Jeenu Viswambharan
Browse files

SDEI: Fix locking issues



The event lock for a shared event was being unlocked twice, and the
locking sequence for event complete was misplaced. This patch fixes both
issues.

Change-Id: Ie2fb15c6ec240af132d7d438946ca160bd5c63dc
Signed-off-by: default avatarJeenu Viswambharan <jeenu.viswambharan@arm.com>
parent ba6e5ca6
...@@ -507,9 +507,6 @@ int sdei_intr_handler(uint32_t intr_raw, uint32_t flags, void *handle, ...@@ -507,9 +507,6 @@ int sdei_intr_handler(uint32_t intr_raw, uint32_t flags, void *handle,
} }
plat_ic_end_of_interrupt(intr_raw); plat_ic_end_of_interrupt(intr_raw);
if (is_event_shared(map))
sdei_map_unlock(map);
return 0; return 0;
} }
...@@ -624,6 +621,9 @@ int sdei_event_complete(bool resume, uint64_t pc) ...@@ -624,6 +621,9 @@ int sdei_event_complete(bool resume, uint64_t pc)
assert(map != NULL); assert(map != NULL);
se = get_event_entry(map); se = get_event_entry(map);
if (is_event_shared(map))
sdei_map_lock(map);
act = resume ? DO_COMPLETE_RESUME : DO_COMPLETE; act = resume ? DO_COMPLETE_RESUME : DO_COMPLETE;
if (!can_sdei_state_trans(se, act)) { if (!can_sdei_state_trans(se, act)) {
if (is_event_shared(map)) if (is_event_shared(map))
...@@ -631,15 +631,15 @@ int sdei_event_complete(bool resume, uint64_t pc) ...@@ -631,15 +631,15 @@ int sdei_event_complete(bool resume, uint64_t pc)
return SDEI_EDENY; return SDEI_EDENY;
} }
if (is_event_shared(map))
sdei_map_unlock(map);
/* Having done sanity checks, pop dispatch */ /* Having done sanity checks, pop dispatch */
(void) pop_dispatch(); (void) pop_dispatch();
SDEI_LOG("EOI:%lx, %d spsr:%lx elr:%lx\n", read_mpidr_el1(), SDEI_LOG("EOI:%lx, %d spsr:%lx elr:%lx\n", read_mpidr_el1(),
map->ev_num, read_spsr_el3(), read_elr_el3()); map->ev_num, read_spsr_el3(), read_elr_el3());
if (is_event_shared(map))
sdei_map_lock(map);
/* /*
* Restore Non-secure to how it was originally interrupted. Once done, * Restore Non-secure to how it was originally interrupted. Once done,
* it's up-to-date with the saved copy. * it's up-to-date with the saved copy.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment