All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] hw/sd: Zero out function selection fields before being populated
@ 2020-10-24  1:49 Bin Meng
  2020-10-24 19:47 ` Philippe Mathieu-Daudé
  2020-10-26  8:08 ` Philippe Mathieu-Daudé
  0 siblings, 2 replies; 6+ messages in thread
From: Bin Meng @ 2020-10-24  1:49 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-block, qemu-devel
  Cc: Bin Meng, Michael Roth

From: Bin Meng <bin.meng@windriver.com>

The function selection fields (399:376) should be zeroed out to
prevent leftover from being or'ed into the switch function status
data structure.

This fixes the boot failure as seen in the acceptance testing on
the orangepi target.

Fixes: b638627c723a ("hw/sd: Fix incorrect populated function switch status data structure")
Reported-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Bin Meng <bin.meng@windriver.com>
---

 hw/sd/sd.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index c3febed243..bd10ec8fc4 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -824,6 +824,7 @@ static void sd_function_switch(SDState *sd, uint32_t arg)
     sd->data[12] = 0x80;	/* Supported group 1 functions */
     sd->data[13] = 0x03;
 
+    memset(&sd->data[14], 0, 3);
     for (i = 0; i < 6; i ++) {
         new_func = (arg >> (i * 4)) & 0x0f;
         if (mode && new_func != 0x0f)
-- 
2.25.1



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

end of thread, other threads:[~2020-10-28 10:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-24  1:49 [PATCH] hw/sd: Zero out function selection fields before being populated Bin Meng
2020-10-24 19:47 ` Philippe Mathieu-Daudé
2020-10-26  8:08 ` Philippe Mathieu-Daudé
2020-10-28  9:47   ` Niek Linnenbank
2020-10-28  1:36     ` Bin Meng
2020-10-28 10:10       ` Philippe Mathieu-Daudé

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.