summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordavidcunado-arm <david.cunado@arm.com>2018-02-27 23:24:30 +0000
committerGitHub <noreply@github.com>2018-02-27 23:24:30 +0000
commitb39d2896b3f6e79c98ea781ee20ad639793ae135 (patch)
tree81755f1298107f8ed05f10d46fb8171db558242c
parentba91a001f8e2ad2f92a7c20270894fcb51365781 (diff)
parentf2928f5baeb0b3f895bb84a99e54bc52a97908bf (diff)
Merge pull request #1283 from jeenu-arm/sdei-fixes
SDEI fixes
-rw-r--r--docs/porting-guide.rst6
-rw-r--r--services/std_svc/sdei/sdei_intr_mgmt.c20
2 files changed, 14 insertions, 12 deletions
diff --git a/docs/porting-guide.rst b/docs/porting-guide.rst
index dbbd102b..3ea95a14 100644
--- a/docs/porting-guide.rst
+++ b/docs/porting-guide.rst
@@ -2022,9 +2022,9 @@ This macro must be defined to the EL3 exception priority level associated with
Critical SDEI events on the platform. This must have a lower value (therefore of
higher priority) than ``PLAT_SDEI_NORMAL_PRI``.
-It's recommended that SDEI exception priorities in general are assigned the
-lowest among Secure priorities. Among the SDEI exceptions, Critical SDEI
-priority must be higher than Normal SDEI priority.
+**Note**: SDEI exception priorities must be the lowest among Secure priorities.
+Among the SDEI exceptions, Critical SDEI priority must be higher than Normal
+SDEI priority.
Functions
.........
diff --git a/services/std_svc/sdei/sdei_intr_mgmt.c b/services/std_svc/sdei/sdei_intr_mgmt.c
index 42bf46d0..2717ea43 100644
--- a/services/std_svc/sdei/sdei_intr_mgmt.c
+++ b/services/std_svc/sdei/sdei_intr_mgmt.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, ARM Limited and Contributors. All rights reserved.
+ * Copyright (c) 2017-2018, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -556,7 +556,7 @@ int sdei_event_complete(int resume, uint64_t pc)
unsigned int client_el = sdei_client_el();
/* Return error if called without an active event */
- disp_ctx = pop_dispatch();
+ disp_ctx = get_outstanding_dispatch();
if (!disp_ctx)
return SDEI_EDENY;
@@ -566,15 +566,8 @@ int sdei_event_complete(int resume, uint64_t pc)
map = disp_ctx->map;
assert(map);
-
se = get_event_entry(map);
- SDEI_LOG("EOI:%lx, %d spsr:%lx elr:%lx\n", read_mpidr_el1(),
- map->ev_num, read_spsr_el3(), read_elr_el3());
-
- if (is_event_shared(map))
- sdei_map_lock(map);
-
act = resume ? DO_COMPLETE_RESUME : DO_COMPLETE;
if (!can_sdei_state_trans(se, act)) {
if (is_event_shared(map))
@@ -582,6 +575,15 @@ int sdei_event_complete(int resume, uint64_t pc)
return SDEI_EDENY;
}
+ /* Having done sanity checks, pop dispatch */
+ pop_dispatch();
+
+ SDEI_LOG("EOI:%lx, %d spsr:%lx elr:%lx\n", read_mpidr_el1(),
+ 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,
* it's up-to-date with the saved copy.