Commit 42c4c78383 for qemu.org
commit 42c4c78383bb078e41780f6a998af4e172eb7f18
Author: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Date: Fri Oct 30 09:47:44 2026 +0100
hw/sd/sdhci: Cancel queued DMA progression on DAT reset
A DAT reset left the transfer timer armed, so the queued DMA
continuation restored DAT Line Active after the reset.
Cancel the timer on DAT reset. Software Reset For DAT Line aborts
DMA transfers (SD Host Controller v1.00, sections 1.5, 2.2.16).
Fixes: d7dfca0807a0 ("hw/sdhci: introduce standard SD host controller")
Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-ID: <20261124073406.87537-3-philmd@oss.qualcomm.com>
diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c
index 1e70e1e7dd..695de6448f 100644
--- a/hw/sd/sdhci.c
+++ b/hw/sd/sdhci.c
@@ -1246,6 +1246,7 @@ static inline void sdhci_reset_write(SDHCIState *s, uint8_t value)
s->norintsts &= ~SDHC_NIS_CMDCMP;
break;
case SDHC_RESET_DATA:
+ timer_del(s->transfer_timer);
s->data_count = 0;
s->prnsts &= ~(SDHC_SPACE_AVAILABLE | SDHC_DATA_AVAILABLE |
SDHC_DOING_READ | SDHC_DOING_WRITE |