public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mmc: disable tuning when checking card presence
@ 2021-06-18  8:23 Wolfram Sang
  2021-06-18 10:34 ` Ulrich Hecht
  2021-06-18 10:42 ` Ulf Hansson
  0 siblings, 2 replies; 12+ messages in thread
From: Wolfram Sang @ 2021-06-18  8:23 UTC (permalink / raw)
  To: linux-mmc
  Cc: linux-renesas-soc, Yoshihiro Shimoda, Wolfram Sang, Ulrich Hecht

When we use the alive callback, we expect a command to fail if the card
is not present. We should not trigger a retune then which will confuse
users with a failed retune on a removed card:

 mmc2: tuning execution failed: -5
 mmc2: card 0001 removed

Disable retuning in this code path.

Reported-by: Ulrich Hecht <uli+renesas@fpond.eu>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 drivers/mmc/core/core.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 54f0814f110c..eb792dd845a3 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -2088,6 +2088,9 @@ int _mmc_detect_card_removed(struct mmc_host *host)
 	if (!host->card || mmc_card_removed(host->card))
 		return 1;
 
+	/* we expect a failure if the card is removed */
+	mmc_retune_disable(host);
+
 	ret = host->bus_ops->alive(host);
 
 	/*
@@ -2107,6 +2110,8 @@ int _mmc_detect_card_removed(struct mmc_host *host)
 		pr_debug("%s: card remove detected\n", mmc_hostname(host));
 	}
 
+	mmc_retune_enable(host);
+
 	return ret;
 }
 
-- 
2.30.2


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

end of thread, other threads:[~2021-06-30  4:09 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-18  8:23 [PATCH] mmc: disable tuning when checking card presence Wolfram Sang
2021-06-18 10:34 ` Ulrich Hecht
2021-06-18 10:42 ` Ulf Hansson
2021-06-21  7:15   ` Adrian Hunter
2021-06-21  7:32     ` Ulrich Hecht
2021-06-21  7:54       ` Adrian Hunter
2021-06-21  8:11         ` Wolfram Sang
2021-06-21  8:26           ` Adrian Hunter
2021-06-26 18:58             ` Wolfram Sang
2021-06-29 14:16               ` Ulf Hansson
2021-06-29 16:01                 ` Adrian Hunter
2021-06-30  4:08             ` Wolfram Sang

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