Commit 23ae8094 authored by Varun Wadekar's avatar Varun Wadekar
Browse files

Tegra: handle FIQ interrupts when NS handler is not registered



This patch updates the secure interrupt handler to mark the interrupt
as complete in case the NS world has not registered a handler.

Change-Id: Iebe952305f7db46375303699b6150611439475df
Signed-off-by: default avatarVarun Wadekar <vwadekar@nvidia.com>
parent ff605ba2
/* /*
* Copyright (c) 2016, ARM Limited and Contributors. All rights reserved. * Copyright (c) 2016-2018, ARM Limited and Contributors. All rights reserved.
* *
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
...@@ -46,8 +46,19 @@ static uint64_t tegra_fiq_interrupt_handler(uint32_t id, ...@@ -46,8 +46,19 @@ static uint64_t tegra_fiq_interrupt_handler(uint32_t id,
(void)handle; (void)handle;
(void)cookie; (void)cookie;
/*
* Read the pending interrupt ID
*/
irq = plat_ic_get_pending_interrupt_id();
bakery_lock_get(&tegra_fiq_lock); bakery_lock_get(&tegra_fiq_lock);
/*
* Jump to NS world only if the NS world's FIQ handler has
* been registered
*/
if (ns_fiq_handler_addr != 0U) {
/* /*
* The FIQ was generated when the execution was in the non-secure * The FIQ was generated when the execution was in the non-secure
* world. Save the context registers to start with. * world. Save the context registers to start with.
...@@ -65,14 +76,14 @@ static uint64_t tegra_fiq_interrupt_handler(uint32_t id, ...@@ -65,14 +76,14 @@ static uint64_t tegra_fiq_interrupt_handler(uint32_t id,
* Set the new ELR to continue execution in the NS world using the * Set the new ELR to continue execution in the NS world using the
* FIQ handler registered earlier. * FIQ handler registered earlier.
*/ */
assert(ns_fiq_handler_addr != 0ULL); cm_set_elr_el3(NON_SECURE, ns_fiq_handler_addr);
write_ctx_reg((el3state_ctx), (uint32_t)(CTX_ELR_EL3), (ns_fiq_handler_addr)); }
/* /*
* Mark this interrupt as complete to avoid a FIQ storm. * Mark this interrupt as complete to avoid a FIQ storm.
*/ */
irq = plat_ic_acknowledge_interrupt();
if (irq < 1022U) { if (irq < 1022U) {
(void)plat_ic_acknowledge_interrupt();
plat_ic_end_of_interrupt(irq); plat_ic_end_of_interrupt(irq);
} }
......
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