Thread (12 messages) 12 messages, 4 authors, 2021-06-30

Re: [PATCH] mmc: disable tuning when checking card presence

From: Adrian Hunter <adrian.hunter@intel.com>
Date: 2021-06-21 07:54:36
Also in: linux-renesas-soc
Subsystem: multimedia card (mmc), secure digital (sd) and sdio subsystem, the rest · Maintainers: Ulf Hansson, Linus Torvalds

On 21/06/21 10:32 am, Ulrich Hecht wrote:
quoted
On 06/21/2021 9:15 AM Adrian Hunter [off-list ref] wrote:
Can we clarify, is the only problem that the error message is confusing?
AFAICT there are no ill effects of the retune failing apart from the error message.
So maybe the simplest thing to do is just amend the message:
e.g.
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 4e52eb14198a..5cbf05e331c4 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -936,13 +936,22 @@ int mmc_execute_tuning(struct mmc_card *card)
 		opcode = MMC_SEND_TUNING_BLOCK;
 
 	err = host->ops->execute_tuning(host, opcode);
-
 	if (err)
-		pr_err("%s: tuning execution failed: %d\n",
-			mmc_hostname(host), err);
-	else
-		mmc_retune_enable(host);
+		goto out_err;
+
+	mmc_retune_enable(host);
 
+	return 0;
+
+out_err:
+	if (mmc_card_is_removable(host)) {
+		if (err != -ENOMEDIUM)
+			pr_err("%s: tuning execution failed: %d (this is normal if card removed)\n",
+			       mmc_hostname(host), err);
+	} else {
+		pr_err("%s: tuning execution failed: %d\n",
+		       mmc_hostname(host), err);
+	}
 	return err;
 }
 

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help