Skip to content

sdhci: assertion in sdhci_read_dataport()

Host environment

  • Operating system: Ubuntu 22.04.4 LTS
  • OS/kernel version: Linux 6.5.0-25-generic
  • Architecture: x86_64
  • QEMU flavor: 9.0.0
  • QEMU version: commit b23acd3e

Description of problem

The following log reveals it:

qemu-system-x86_64: qemu/hw/sd/sdhci.c:476: uint32_t sdhci_read_dataport(SDHCIState *, unsigned int): Assertion `s->data_count < s->buf_maxsz' failed.
Aborted (core dumped)

Reproducer

cat << EOF | qemu-system-x86_64 \
-display none -machine accel=qtest, -m 512M -nodefaults -device \
sdhci-pci,sd-spec-version=3 -device sd-card,drive=mydrive -drive \
if=none,index=0,file=null-co://,format=raw,id=mydrive -nographic -qtest \
stdio
outl 0xcf8 0x80001010
outl 0xcfc 0xe0000000
outl 0xcf8 0x80001004
outw 0xcfc 0x06
write 0xe000000c 0x1 0x11
write 0xe000000e 0x1 0x20
write 0xe0000058 0x1 0x90
write 0xe0000059 0x1 0x3d
write 0xe000005a 0x1 0x3d
write 0xe0000028 0x1 0x08
write 0xe0000005 0x1 0x02
write 0xe000002c 0x1 0x05
write 0x3d3d90 0x1 0x21
write 0x3d3d93 0x1 0x20
write 0xe000000f 0x1 0x00
write 0xe000002a 0x1 0x01
write 0xe000002a 0x1 0x02
readq 0xe000001f
EOF
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information