[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] hw/sd: Zero out function selection fields before being popul

From: Philippe Mathieu-Daudé
Subject: Re: [PATCH] hw/sd: Zero out function selection fields before being populated
Date: Sat, 24 Oct 2020 21:47:08 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.3.1

On 10/24/20 3:49 AM, Bin Meng wrote:
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 
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);

This is indeed the simpler fix. Thanks for looking at
it so quickly!

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

      for (i = 0; i < 6; i ++) {
          new_func = (arg >> (i * 4)) & 0x0f;
          if (mode && new_func != 0x0f)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]