qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 0/2] fix SD card migration
@ 2023-01-20 12:01 Daniel Henrique Barboza
  2023-01-20 12:01 ` [RFC PATCH 1/2] hw/sd/sd.c: add sd_card_powered_up() Daniel Henrique Barboza
  2023-01-20 12:01 ` [RFC PATCH 2/2] hw/sd: skip double power-up in sd_vmstate_pre_load() Daniel Henrique Barboza
  0 siblings, 2 replies; 6+ messages in thread
From: Daniel Henrique Barboza @ 2023-01-20 12:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: Daniel Henrique Barboza, Philippe Mathieu-Daudé, Bin Meng

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é <philmd@linaro.org>
Cc: Bin Meng <bin.meng@windriver.com>

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(-)

-- 
2.39.0



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-02-01 20:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-20 12:01 [RFC PATCH 0/2] fix SD card migration Daniel Henrique Barboza
2023-01-20 12:01 ` [RFC PATCH 1/2] hw/sd/sd.c: add sd_card_powered_up() Daniel Henrique Barboza
2023-01-20 12:01 ` [RFC PATCH 2/2] hw/sd: skip double power-up in sd_vmstate_pre_load() Daniel Henrique Barboza
2023-01-20 12:38   ` Philippe Mathieu-Daudé
2023-01-23 12:09     ` Dr. David Alan Gilbert
2023-02-01 20:52     ` Juan Quintela

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).