From c390467d1903c926116a918a09875477d25f19d8 Mon Sep 17 00:00:00 2001 From: Aidan MacDonald Date: Fri, 6 Feb 2026 11:53:20 +0000 Subject: [PATCH] stm32h7: sdmmc: don't panic on spurious IRQs When doing I/O, the interrupt can rarely fire with no active command and no status bits set. This is probably because the interrupt is set pending by the NVIC while the handler is already running, so should be harmless. Change-Id: I0c2570abe6e3c85ddbfa2ebe0afcf8677b77408f --- firmware/target/arm/stm32/sdmmc-stm32h7.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/firmware/target/arm/stm32/sdmmc-stm32h7.c b/firmware/target/arm/stm32/sdmmc-stm32h7.c index 0fdad1156a..b61c778376 100644 --- a/firmware/target/arm/stm32/sdmmc-stm32h7.c +++ b/firmware/target/arm/stm32/sdmmc-stm32h7.c @@ -407,7 +407,12 @@ void stm32h7_sdmmc_irq_handler(struct stm32h7_sdmmc_controller *ctl) uint32_t icr = 0; if (!ctl->cmd_wait) - panicf("sdmmc_irq: not waiting: %08lx", star); + { + if (star != 0) + panicf("sdmmc_irq: not waiting: %08lx", star); + + return; + } /* * Ignore interrupts which we haven't enabled; this is needed