Skip to content

RFC fix SD card migration

Daniel Henrique Barboza qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest2 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2hw/sd/sd.c: add sd_card_powered_up()hw/sd/sd.c+8 -30 replies
2/2hw/sd: skip double power-up in sd_vmstate_pre_load()hw/sd/sd.c+10 -23 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 0/2] fix SD card migration

Hi,

I found this bug by accident when doing avocado tests with the RISC-V machines. Trying to migrate the sifive_u machine, which always has a SD card, fails every time:

qemu-system-riscv64: ../hw/sd/sd.c:297: sd_ocr_powerup: Assertion `!FIELD_EX32(sd->ocr, OCR, CARD_POWER_UP)' failed.

I'm sending it as RFC because I am not sure if this fix is a bandaid for something else that should be worked on. The code in question was introduced a while ago to circumvent a power on bug with EDK2, where a timer was introduced to power on the card after receiving a ACMD41 event/command. There is a possibility that the assumptions made back then no longer hold true.

Cc Philippe Mathieu-Daudé <[email protected]>
Cc Bin Meng <[email protected]>

Daniel Henrique Barboza (2):
hw/sd/sd.c: add sd_card_powered_up()
hw/sd: skip double power-up in sd_vmstate_pre_load()

 hw/sd/sd.c | 23 ++++++++++++++++++-----
 1 file changed, 18 insertions(+), 5 deletions(-)
Signature · 1 line
2.39.0