[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 5/5] hw/sd/sdcard: Zero out function selection fields before being
From: |
Philippe Mathieu-Daudé |
Subject: |
[PULL 5/5] hw/sd/sdcard: Zero out function selection fields before being populated |
Date: |
Mon, 26 Oct 2020 12:03:15 +0100 |
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>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20201024014954.21330-1-bmeng.cn@gmail.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
hw/sd/sd.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index fcbc1fd9d6e..30913826145 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -827,6 +827,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.26.2
- [PULL 0/5] SD/MMC patches for 2020-10-26, Philippe Mathieu-Daudé, 2020/10/26
- [PULL 1/5] hw/sd/sdcard: Update the SDState documentation, Philippe Mathieu-Daudé, 2020/10/26
- [PULL 2/5] hw/sd/sdcard: Simplify cmd_valid_while_locked(), Philippe Mathieu-Daudé, 2020/10/26
- [PULL 3/5] hw/sd/sdcard: Constify sd_crc*()'s message argument, Philippe Mathieu-Daudé, 2020/10/26
- [PULL 5/5] hw/sd/sdcard: Zero out function selection fields before being populated,
Philippe Mathieu-Daudé <=
- [PULL 4/5] hw/sd/sdcard: Make iolen unsigned, Philippe Mathieu-Daudé, 2020/10/26
- Re: [PULL 0/5] SD/MMC patches for 2020-10-26, Peter Maydell, 2020/10/26