All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bin Meng <bmeng.cn@gmail.com>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
Cc: Peter Maydell <peter.maydell@linaro.org>,
	qemu-block@nongnu.org,
	Sai Pavan Boddu <sai.pavan.boddu@xilinx.com>,
	Bin Meng <bin.meng@windriver.com>,
	"qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>,
	Andrew Baumann <Andrew.Baumann@microsoft.com>,
	Beniamino Galvani <b.galvani@gmail.com>,
	Niek Linnenbank <nieklinnenbank@gmail.com>,
	qemu-arm <qemu-arm@nongnu.org>, Michael Walle <michael@walle.cc>
Subject: Re: [PULL 22/23] hw/sd: Fix incorrect populated function switch status data structure
Date: Wed, 21 Oct 2020 17:57:33 +0800	[thread overview]
Message-ID: <CAEUhbmVFZ8aWdv48D8acdfFRp6WMYL6n=ENeo4hBZfmqE9TrDA@mail.gmail.com> (raw)
In-Reply-To: <e378932a-1de3-83c1-834f-ae6526604cb7@amsat.org>

Hi Philippe,

On Tue, Oct 20, 2020 at 11:18 PM Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
>
> Hi Bin,
>
> On 8/21/20 7:29 PM, Philippe Mathieu-Daudé wrote:
> > From: Bin Meng <bin.meng@windriver.com>
> >
> > At present the function switch status data structure bit [399:376]
> > are wrongly pupulated. These 3 bytes encode function switch status
> > for the 6 function groups, with 4 bits per group, starting from
> > function group 6 at bit 399, then followed by function group 5 at
> > bit 395, and so on.
> >
> > However the codes mistakenly fills in the function group 1 status
> > at bit 399. This fixes the code logic.
> >
> > Fixes: a1bb27b1e9 ("SD card emulation (initial implementation)")
> > Signed-off-by: Bin Meng <bin.meng@windriver.com>
> > Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> > Tested-by: Sai Pavan Boddu <sai.pavan.boddu@xilinx.com>
> > Message-Id: <1598021136-49525-1-git-send-email-bmeng.cn@gmail.com>
> > Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> > ---
> >   hw/sd/sd.c | 3 ++-
> >   1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/hw/sd/sd.c b/hw/sd/sd.c
> > index 7c9d956f113..805e21fc883 100644
> > --- a/hw/sd/sd.c
> > +++ b/hw/sd/sd.c
> > @@ -807,11 +807,12 @@ static void sd_function_switch(SDState *sd, uint32_t arg)
> >       sd->data[11] = 0x43;
> >       sd->data[12] = 0x80;    /* Supported group 1 functions */
> >       sd->data[13] = 0x03;
> > +
> >       for (i = 0; i < 6; i ++) {
> >           new_func = (arg >> (i * 4)) & 0x0f;
> >           if (mode && new_func != 0x0f)
> >               sd->function_group[i] = new_func;
> > -        sd->data[14 + (i >> 1)] = new_func << ((i * 4) & 4);
> > +        sd->data[16 - (i >> 1)] |= new_func << ((i % 2) * 4);
>
> This patch broke the orangepi machine, reproducible running
> test_arm_orangepi_bionic:
> https://www.mail-archive.com/qemu-devel@nongnu.org/msg739449.html
>
> Can you have a look?

Yes, I can take a look. Could you please send more details on how to
run "test_arm_orangepi_bionic"?

Regards,
Bin


  reply	other threads:[~2020-10-21  9:58 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-21 17:28 [PULL 00/23] SD/MMC patches for 2020-08-21 Philippe Mathieu-Daudé
2020-08-21 17:28 ` [PULL 01/23] hw/sd/pxa2xx_mmci: Do not create SD card within the SD host controller Philippe Mathieu-Daudé
2020-08-21 17:28 ` [PULL 02/23] hw/sd/pxa2xx_mmci: Trivial simplification Philippe Mathieu-Daudé
2020-08-21 17:28 ` [PULL 03/23] hw/lm32/milkymist: Un-inline milkymist_memcard_create() Philippe Mathieu-Daudé
2020-08-21 17:28 ` [PULL 04/23] hw/sd/milkymist: Create the SDBus at init() Philippe Mathieu-Daudé
2020-08-21 17:28 ` [PULL 05/23] hw/sd/milkymist: Do not create SD card within the SD host controller Philippe Mathieu-Daudé
2020-08-21 17:28 ` [PULL 06/23] hw/sd/pl181: Replace fprintf(stderr, "*\n") with error_report() Philippe Mathieu-Daudé
2020-08-21 17:29 ` [PULL 07/23] hw/sd/pl181: Rename pl181_send_command() as pl181_do_command() Philippe Mathieu-Daudé
2020-08-21 17:29 ` [PULL 08/23] hw/sd/pl181: Add TODO to use Fifo32 API Philippe Mathieu-Daudé
2020-08-21 17:29 ` [PULL 09/23] hw/sd/pl181: Use named GPIOs Philippe Mathieu-Daudé
2020-08-21 17:29 ` [PULL 10/23] hw/sd/pl181: Expose a SDBus and connect the SDCard to it Philippe Mathieu-Daudé
2020-08-21 17:29 ` [PULL 11/23] hw/sd/pl181: Do not create SD card within the SD host controller Philippe Mathieu-Daudé
2020-08-21 17:29 ` [PULL 12/23] hw/sd/pl181: Replace disabled fprintf()s by trace events Philippe Mathieu-Daudé
2020-08-21 17:29 ` [PULL 13/23] hw/sd/sdcard: Make sd_data_ready() static Philippe Mathieu-Daudé
2020-08-21 17:29 ` [PULL 14/23] hw/sd: Move sdcard legacy API to 'hw/sd/sdcard_legacy.h' Philippe Mathieu-Daudé
2020-08-21 17:29 ` [PULL 15/23] hw/sd: Rename read/write_data() as read/write_byte() Philippe Mathieu-Daudé
2020-08-21 17:29 ` [PULL 16/23] hw/sd: Rename sdbus_write_data() as sdbus_write_byte() Philippe Mathieu-Daudé
2020-08-21 17:29 ` [PULL 17/23] hw/sd: Rename sdbus_read_data() as sdbus_read_byte() Philippe Mathieu-Daudé
2020-08-21 17:29 ` [PULL 18/23] hw/sd: Add sdbus_write_data() to write multiples bytes on the data line Philippe Mathieu-Daudé
2020-08-21 17:29 ` [PULL 19/23] hw/sd: Use sdbus_write_data() instead of sdbus_write_byte when possible Philippe Mathieu-Daudé
2020-08-21 17:29 ` [PULL 20/23] hw/sd: Add sdbus_read_data() to read multiples bytes on the data line Philippe Mathieu-Daudé
2020-08-21 17:29 ` [PULL 21/23] hw/sd: Use sdbus_read_data() instead of sdbus_read_byte() when possible Philippe Mathieu-Daudé
2020-08-21 17:29 ` [PULL 22/23] hw/sd: Fix incorrect populated function switch status data structure Philippe Mathieu-Daudé
2020-10-20 15:16   ` Philippe Mathieu-Daudé
2020-10-21  9:57     ` Bin Meng [this message]
2020-10-21 10:07       ` Philippe Mathieu-Daudé
2020-10-22 14:47         ` Bin Meng
2020-10-22 15:20           ` Niek Linnenbank
2020-10-23  2:02             ` Bin Meng
2020-10-23  9:23               ` Philippe Mathieu-Daudé
2020-10-23  9:34                 ` Should we keep using Avocado for functional testing? (was: Re: [PULL 22/23] hw/sd: Fix incorrect populated function switch status data structure) Philippe Mathieu-Daudé
2020-10-24 21:41                   ` Niek Linnenbank
2020-10-26 16:14                   ` Cleber Rosa
2020-08-21 17:29 ` [PULL 23/23] hw/sd: Correct the maximum size of a Standard Capacity SD Memory Card Philippe Mathieu-Daudé
2020-08-23 10:37 ` [PULL 00/23] SD/MMC patches for 2020-08-21 Peter Maydell

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='CAEUhbmVFZ8aWdv48D8acdfFRp6WMYL6n=ENeo4hBZfmqE9TrDA@mail.gmail.com' \
    --to=bmeng.cn@gmail.com \
    --cc=Andrew.Baumann@microsoft.com \
    --cc=b.galvani@gmail.com \
    --cc=bin.meng@windriver.com \
    --cc=f4bug@amsat.org \
    --cc=michael@walle.cc \
    --cc=nieklinnenbank@gmail.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=sai.pavan.boddu@xilinx.com \
    /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 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.