Linux MultiMedia Card development
 help / color / mirror / Atom feed
* [PATCH RFC] HACK: mmc: core: also abort tuning with CMD12 for SD
@ 2021-08-31 13:33 Wolfram Sang
  2021-09-09  8:54 ` Ulf Hansson
  0 siblings, 1 reply; 4+ messages in thread
From: Wolfram Sang @ 2021-08-31 13:33 UTC (permalink / raw)
  To: linux-mmc
  Cc: linux-renesas-soc, Ulf Hansson, Adrian Hunter, Yoshihiro Shimoda,
	Wolfram Sang

We have various SanDisk cards which fail tuning to SDR104 unless we
allow a CMD12 also to be sent to abort a broken tuning. It is true that
the SD specs do not mention that CMD12 is allowed, but they also don't
say it is forbidden. And now reality tells that it is needed to make
some cards work. Other cards I tried did not regress.

If we can agree to allow this for SD, then the problem is now SDIO which
does not support CMD12. mmc_card_sdio() does not work at this stage
because host->card is still NULL. Is there any other way to distinguish
SD and SDIO here?

Not-Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---

Hey guys,

so, there are two questions here:
1) despite not being mentioned in the spec, do we want to allow CMD12 to
   abort tuning for SD as well?

2) If so, how to make sure not apply it to SDIO but SD only?

Thanks for your input! Kind regards,

   Wolfram


 drivers/mmc/core/mmc_ops.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/drivers/mmc/core/mmc_ops.c b/drivers/mmc/core/mmc_ops.c
index 973756ed4016..02d378255895 100644
--- a/drivers/mmc/core/mmc_ops.c
+++ b/drivers/mmc/core/mmc_ops.c
@@ -704,14 +704,6 @@ int mmc_send_abort_tuning(struct mmc_host *host, u32 opcode)
 {
 	struct mmc_command cmd = {};
 
-	/*
-	 * eMMC specification specifies that CMD12 can be used to stop a tuning
-	 * command, but SD specification does not, so do nothing unless it is
-	 * eMMC.
-	 */
-	if (opcode != MMC_SEND_TUNING_BLOCK_HS200)
-		return 0;
-
 	cmd.opcode = MMC_STOP_TRANSMISSION;
 	cmd.flags = MMC_RSP_SPI_R1 | MMC_RSP_R1 | MMC_CMD_AC;
 
-- 
2.30.2


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

end of thread, other threads:[~2021-09-09 14:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-08-31 13:33 [PATCH RFC] HACK: mmc: core: also abort tuning with CMD12 for SD Wolfram Sang
2021-09-09  8:54 ` Ulf Hansson
2021-09-09 13:03   ` Wolfram Sang
2021-09-09 14:35     ` Ulf Hansson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox