From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Joel Stanley" <joel@jms.id.au>,
qemu-block@nongnu.org, "Cédric Le Goater" <clg@kaod.org>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Bin Meng" <bmeng.cn@gmail.com>,
"Jan Kiszka" <jan.kiszka@siemens.com>,
"Christian Speich" <c.speich@avm.de>
Subject: [PATCH-for-10.2] hw/sd/sdcard: Correct SCR 'DATA_STAT_AFTER_ERASE' bit
Date: Mon, 24 Nov 2025 05:20:08 +0100 [thread overview]
Message-ID: <20251124042008.55710-1-philmd@linaro.org> (raw)
As a 'SD card vendor', QEMU chose to fill blocks with '1'
during erase operation. Update the DATA_STAT_AFTER_ERASE
SCR bit appropriately.
Fixes: 818a5cdcfcf ("hw/sd: sd: Actually perform the erase operation")
Reported-by: Christian Speich <c.speich@avm.de>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/sd/sd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 40a75a43ffb..d35537702b2 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -446,7 +446,7 @@ static void sd_set_scr(SDState *sd)
/* reserved for manufacturer usage */
sd->scr[4] = 0x00;
sd->scr[5] = 0x00;
- sd->scr[6] = 0x00;
+ sd->scr[6] = 1 << 7; /* Data after an erase operation is 0xff */
sd->scr[7] = 0x00;
}
--
2.51.0
next reply other threads:[~2025-11-24 4:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-24 4:20 Philippe Mathieu-Daudé [this message]
2025-11-25 9:31 ` [PATCH-for-10.2] hw/sd/sdcard: Correct SCR 'DATA_STAT_AFTER_ERASE' bit Christian Speich
2025-11-25 10:24 ` Christian Speich
2025-11-25 10:07 ` Christian Speich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251124042008.55710-1-philmd@linaro.org \
--to=philmd@linaro.org \
--cc=bmeng.cn@gmail.com \
--cc=c.speich@avm.de \
--cc=clg@kaod.org \
--cc=jan.kiszka@siemens.com \
--cc=joel@jms.id.au \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).