diff options
author | Sandrine Bailleux <sandrine.bailleux@arm.com> | 2018-04-12 17:06:20 +0200 |
---|---|---|
committer | Sandrine Bailleux <sandrine.bailleux@arm.com> | 2018-04-12 17:14:41 +0200 |
commit | 63ae06cec4b5e7e1010e638bc407e98ad2bf8020 (patch) | |
tree | 0ae3c559337b15ff8586acb3d63c375737a17bfa /framework | |
parent | 848fffb161c4c48e61ec9b2780848f2db2bda1cf (diff) |
Remove calls to mp_printf() in ISRs
We should never call mp_printf() in ISRs because this function tries
to acquire the printf spinlock, which can put us in a deadlock
situation.
Imagine a test where:
1) We register an ISR for the timer interrupt. This ISR calls mp_printf().
2) We program the timer to fire in the near future.
3) We print something on the console.
Now, if the timer interrupt fires while we were printing on the console
(i.e. while holding the printf lock) then the ISR will never be able to
acquire the lock again and that will just lock up the system.
This also applies to the INFO/VERBOSE/... macros which call into
mp_printf().
This patch removes all prints from ISRs in existing tests.
Change-Id: Idffc02dbdf0f730790b1f1602e50b805073acc27
Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
Diffstat (limited to 'framework')
-rw-r--r-- | framework/timer/timer_framework.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/framework/timer/timer_framework.c b/framework/timer/timer_framework.c index fd44aa3..593644b 100644 --- a/framework/timer/timer_framework.c +++ b/framework/timer/timer_framework.c @@ -453,7 +453,12 @@ int tftf_timer_framework_handler(void *data) plat_timer_info->handler(); if (arm_gic_is_intr_pending(TIMER_IRQ)) { - ERROR(" Timer IRQ still pending. Fatal error.\n"); + /* + * We might never manage to acquire the printf lock here + * (because we are in ISR context) but we're gonna panic right + * after anyway so it doesn't really matter. + */ + ERROR("Timer IRQ still pending. Fatal error.\n"); panic(); } |