All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mmc: mmc_spi: Do not drop first RX byte after CMD TX
@ 2021-01-24  6:34 Jiaxun Yang
  2021-01-24 11:38 ` Meng, Bin
  0 siblings, 1 reply; 3+ messages in thread
From: Jiaxun Yang @ 2021-01-24  6:34 UTC (permalink / raw)
  To: u-boot

As per MMC SPI specification, R1 response could just follow
the CMD TX. Currently we drop the first RX byte after the CMD
TX. It is harmless in realworld as MMC card need time to take
command action so the first resp will always be R1b(busy).

However in QEMU ssi-sd emulation, R1 resp is just followed after,
so R1 will be dropped here.

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
---
 drivers/mmc/mmc_spi.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/mmc/mmc_spi.c b/drivers/mmc/mmc_spi.c
index 46800bbed2..1da963ba1e 100644
--- a/drivers/mmc/mmc_spi.c
+++ b/drivers/mmc/mmc_spi.c
@@ -94,10 +94,6 @@ static int mmc_spi_sendcmd(struct udevice *dev,
 	if (ret)
 		return ret;
 
-	ret = dm_spi_xfer(dev, 1 * 8, NULL, &r, 0);
-	if (ret)
-		return ret;
-
 	if (!resp || !resp_size)
 		return 0;
 
-- 
2.30.0

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

* [PATCH] mmc: mmc_spi: Do not drop first RX byte after CMD TX
  2021-01-24  6:34 [PATCH] mmc: mmc_spi: Do not drop first RX byte after CMD TX Jiaxun Yang
@ 2021-01-24 11:38 ` Meng, Bin
  2021-01-25  3:32   ` Jiaxun Yang
  0 siblings, 1 reply; 3+ messages in thread
From: Meng, Bin @ 2021-01-24 11:38 UTC (permalink / raw)
  To: u-boot

It looks somehow this email did not arrive the mailing list?

As for the patch, U-Boot mms_spi driver does nothing wrong. The dropped byte is for Ncr as required by the spec.

The issue you mentioned in QEMU is fixed by the following patch:
http://patchwork.ozlabs.org/project/qemu-devel/patch/20210123104016.17485-4-bmeng.cn at gmail.com/

Regards,
Bin

-----Original Message-----
From: Jiaxun Yang <jiaxun.yang@flygoat.com> 
Sent: Sunday, January 24, 2021 2:34 PM
To: u-boot at lists.denx.de
Cc: Meng, Bin <Bin.Meng@windriver.com>; peng.fan at nxp.com; Jiaxun Yang <jiaxun.yang@flygoat.com>
Subject: [PATCH] mmc: mmc_spi: Do not drop first RX byte after CMD TX

As per MMC SPI specification, R1 response could just follow the CMD TX. Currently we drop the first RX byte after the CMD TX. It is harmless in realworld as MMC card need time to take command action so the first resp will always be R1b(busy).

However in QEMU ssi-sd emulation, R1 resp is just followed after, so R1 will be dropped here.

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
---
 drivers/mmc/mmc_spi.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/mmc/mmc_spi.c b/drivers/mmc/mmc_spi.c index 46800bbed2..1da963ba1e 100644
--- a/drivers/mmc/mmc_spi.c
+++ b/drivers/mmc/mmc_spi.c
@@ -94,10 +94,6 @@ static int mmc_spi_sendcmd(struct udevice *dev,
 	if (ret)
 		return ret;
 
-	ret = dm_spi_xfer(dev, 1 * 8, NULL, &r, 0);
-	if (ret)
-		return ret;
-
 	if (!resp || !resp_size)
 		return 0;
 
--
2.30.0

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

* [PATCH] mmc: mmc_spi: Do not drop first RX byte after CMD TX
  2021-01-24 11:38 ` Meng, Bin
@ 2021-01-25  3:32   ` Jiaxun Yang
  0 siblings, 0 replies; 3+ messages in thread
From: Jiaxun Yang @ 2021-01-25  3:32 UTC (permalink / raw)
  To: u-boot

? 2021/1/24 ??7:38, Meng, Bin ??:
> It looks somehow this email did not arrive the mailing list?

Yes, it is waiting list moderator for approval as it's my first mail to 
U-Boot list.

>
> As for the patch, U-Boot mms_spi driver does nothing wrong. The dropped byte is for Ncr as required by the spec.
>
> The issue you mentioned in QEMU is fixed by the following patch:
> http://patchwork.ozlabs.org/project/qemu-devel/patch/20210123104016.17485-4-bmeng.cn at gmail.com/

Thanks, It solved by problem.

- Jiaxun

>
> Regards,
> Bin
>

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

end of thread, other threads:[~2021-01-25  3:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-24  6:34 [PATCH] mmc: mmc_spi: Do not drop first RX byte after CMD TX Jiaxun Yang
2021-01-24 11:38 ` Meng, Bin
2021-01-25  3:32   ` Jiaxun Yang

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.