[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 17/28] hw/sd/sdhci: Reset @data_count index on invalid ADMA transf
From: |
Philippe Mathieu-Daudé |
Subject: |
[PULL 17/28] hw/sd/sdhci: Reset @data_count index on invalid ADMA transfers |
Date: |
Tue, 6 Aug 2024 14:51:45 +0200 |
We neglected to clear the @data_count index on ADMA error,
allowing to trigger assertion in sdhci_read_dataport() or
sdhci_write_dataport().
Cc: qemu-stable@nongnu.org
Fixes: d7dfca0807 ("hw/sdhci: introduce standard SD host controller")
Reported-by: Zheyu Ma <zheyuma97@gmail.com>
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2455
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20240730092138.32443-4-philmd@linaro.org>
---
hw/sd/sdhci.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c
index d02c3e3963..8293d83556 100644
--- a/hw/sd/sdhci.c
+++ b/hw/sd/sdhci.c
@@ -846,6 +846,7 @@ static void sdhci_do_adma(SDHCIState *s)
}
}
if (res != MEMTX_OK) {
+ s->data_count = 0;
if (s->errintstsen & SDHC_EISEN_ADMAERR) {
trace_sdhci_error("Set ADMA error flag");
s->errintsts |= SDHC_EIS_ADMAERR;
--
2.45.2
- [PULL 08/28] hw/intc/loongson_ipi: Add LoongsonIPICommonClass::get_iocsr_as handler, (continued)
- [PULL 08/28] hw/intc/loongson_ipi: Add LoongsonIPICommonClass::get_iocsr_as handler, Philippe Mathieu-Daudé, 2024/08/06
- [PULL 09/28] hw/intc/loongson_ipi: Add LoongsonIPICommonClass::cpu_by_arch_id handler, Philippe Mathieu-Daudé, 2024/08/06
- [PULL 11/28] hw/intc/loongson_ipi: Move common code to loongson_ipi_common.c, Philippe Mathieu-Daudé, 2024/08/06
- [PULL 10/28] hw/intc/loongson_ipi: Expose loongson_ipi_core_read/write helpers, Philippe Mathieu-Daudé, 2024/08/06
- [PULL 12/28] hw/intc/loongarch_ipi: Add loongarch IPI support, Philippe Mathieu-Daudé, 2024/08/06
- [PULL 13/28] hw/loongarch/virt: Replace Loongson IPI with LoongArch IPI, Philippe Mathieu-Daudé, 2024/08/06
- [PULL 14/28] hw/intc/loongson_ipi: Restrict to MIPS, Philippe Mathieu-Daudé, 2024/08/06
- [PULL 15/28] hw/sd/sdcard: Explicit dummy byte value, Philippe Mathieu-Daudé, 2024/08/06
- [PULL 16/28] hw/sd/sdcard: Do not abort when reading DAT lines on invalid cmd state, Philippe Mathieu-Daudé, 2024/08/06
- [PULL 17/28] hw/sd/sdhci: Reset @data_count index on invalid ADMA transfers,
Philippe Mathieu-Daudé <=
- [PULL 18/28] hw/block/pflash_cfi01: Don't decrement pfl->counter below 0, Philippe Mathieu-Daudé, 2024/08/06
- [PULL 19/28] hw/ide/atapi: Be explicit that assigning to s->lcyl truncates, Philippe Mathieu-Daudé, 2024/08/06
- [PULL 20/28] hw/block/fdc-isa: Assert that isa_fdc_get_drive_max_chs() found something, Philippe Mathieu-Daudé, 2024/08/06
- [PULL 23/28] system/vl.c: Expand OpenGL related errors, Philippe Mathieu-Daudé, 2024/08/06
- [PULL 22/28] hw/display/virtio-gpu: Improve "opengl is not available" error message, Philippe Mathieu-Daudé, 2024/08/06
- [PULL 24/28] ui/console: Note in '-display help' that some backends support suboptions, Philippe Mathieu-Daudé, 2024/08/06
- [PULL 21/28] hw/ide/pci: Remove dead code from bmdma_prepare_buf(), Philippe Mathieu-Daudé, 2024/08/06
- [PULL 27/28] docs/specs/pci-ids: Add missing devices, Philippe Mathieu-Daudé, 2024/08/06
- [PULL 25/28] hw/pci-host/gt64120: Set PCI base address register write mask, Philippe Mathieu-Daudé, 2024/08/06
- [PULL 26/28] hw/pci-host/gt64120: Reset config registers during RESET phase, Philippe Mathieu-Daudé, 2024/08/06