From ef8b01390dbddc3f4a000be963fad53d79390411 Mon Sep 17 00:00:00 2001 From: Kent McLeod Date: Wed, 18 Sep 2019 19:34:00 +1000 Subject: [PATCH] KernelIRQReporting: Change reserved IRQ reporting Reserved IRQ reporting would print on every received reserved IRQ. This feature is supposed to report spurious interrupts, yet most cases reserved IRQs are not spurious. We change the printing to only print if the reserved IRQ was unhandled. The intention is to allow more app configurations to leave this feature enabled in development builds. --- include/arch/arm/arch/object/interrupt.h | 8 ++++---- include/arch/riscv/arch/object/interrupt.h | 2 +- include/plat/pc99/plat/machine/interrupt.h | 8 ++++---- src/object/interrupt.c | 3 --- 4 files changed, 9 insertions(+), 12 deletions(-) diff --git a/include/arch/arm/arch/object/interrupt.h b/include/arch/arm/arch/object/interrupt.h index 40bd3c3b7..d01d77482 100644 --- a/include/arch/arm/arch/object/interrupt.h +++ b/include/arch/arm/arch/object/interrupt.h @@ -23,10 +23,6 @@ exception_t Arch_decodeIRQControlInvocation(word_t invLabel, word_t length, /* Handle a platform-reserved IRQ. */ static inline void handleReservedIRQ(irq_t irq) { -#ifdef CONFIG_IRQ_REPORTING - printf("Received reserved IRQ: %d\n", (int)irq); -#endif - #ifdef CONFIG_ARM_ENABLE_PMU_OVERFLOW_INTERRUPT if (irq == KERNEL_PMU_IRQ) { handleOverflowIRQ(); @@ -47,6 +43,10 @@ static inline void handleReservedIRQ(irq_t irq) return; } #endif + +#ifdef CONFIG_IRQ_REPORTING + printf("Received unhandled reserved IRQ: %d\n", (int)irq); +#endif } diff --git a/include/arch/riscv/arch/object/interrupt.h b/include/arch/riscv/arch/object/interrupt.h index a14cc668d..cee408289 100644 --- a/include/arch/riscv/arch/object/interrupt.h +++ b/include/arch/riscv/arch/object/interrupt.h @@ -18,7 +18,7 @@ static inline void handleReservedIRQ(irq_t irq) { #ifdef CONFIG_IRQ_REPORTING - printf("Received reserved IRQ: %d\n", (int)irq); + printf("Received unhandled reserved IRQ: %d\n", (int)irq); #endif } diff --git a/include/plat/pc99/plat/machine/interrupt.h b/include/plat/pc99/plat/machine/interrupt.h index 340095f2e..46c97ad64 100644 --- a/include/plat/pc99/plat/machine/interrupt.h +++ b/include/plat/pc99/plat/machine/interrupt.h @@ -25,16 +25,16 @@ static inline void handleReservedIRQ(irq_t irq) { -#ifdef CONFIG_IRQ_REPORTING - printf("Received reserved IRQ: %d\n", (int)irq); -#endif - #ifdef CONFIG_IOMMU if (irq == irq_iommu) { vtd_handle_fault(); return; } #endif + +#ifdef CONFIG_IRQ_REPORTING + printf("Received unhandled reserved IRQ: %d\n", (int)irq); +#endif } static inline void receivePendingIRQ(void) diff --git a/src/object/interrupt.c b/src/object/interrupt.c index 55a0be84e..8f862c454 100644 --- a/src/object/interrupt.c +++ b/src/object/interrupt.c @@ -235,9 +235,6 @@ void handleInterrupt(irq_t irq) #endif /* ENABLE_SMP_SUPPORT */ case IRQReserved: -#ifdef CONFIG_IRQ_REPORTING - printf("Received reserved IRQ: %d", (int)irq); -#endif handleReservedIRQ(irq); break;