Commit dec50842c1 for qemu.org

commit dec50842c1c65c6492122966757f55eae13693cb
Author: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Date:   Tue Nov 24 08:29:38 2026 +0100

    hw/sd/sdhci: Gate Auto CMD12 error status on its enable

    The Force Event write for Auto CMD12 Error Status (also reached from
    the Error Interrupt Force Event register) set the Error Interrupt
    Auto CMD12 bit regardless of the Auto CMD12 Error Status Enable.

    Gate it on the enable, as the command-timeout path does.

    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-5-philmd@oss.qualcomm.com>

diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c
index 9bdc898e7f..f33e2cec9b 100644
--- a/hw/sd/sdhci.c
+++ b/hw/sd/sdhci.c
@@ -1442,7 +1442,7 @@ sdhci_write(void *opaque, hwaddr offset, uint64_t val, unsigned size)
     case SDHC_FEAER:
         s->acmd12errsts |= value;
         s->errintsts |= (value >> 16) & s->errintstsen;
-        if (s->acmd12errsts) {
+        if (s->acmd12errsts && (s->errintstsen & SDHC_EISEN_CMD12ERR)) {
             s->errintsts |= SDHC_EIS_CMD12ERR;
         }
         if (s->errintsts) {