Linux MultiMedia Card development
 help / color / mirror / Atom feed
From: Erick Shepherd <erick.shepherd@ni.com>
To: <linux-kernel@vger.kernel.org>
Cc: <linux-mmc@vger.kernel.org>, <ulf.hansson@linaro.org>,
	<adrian.hunter@intel.com>, <avri.altman@wdc.com>,
	<wsa+renesas@sang-engineering.com>, <quic_jjohnson@quicinc.com>,
	<andy-ld.lu@mediatek.com>, <victor.shih@genesyslogic.com.tw>,
	<keita.aihara@sony.com>, <dsimic@manjaro.org>,
	<cw9316.lee@samsung.com>, <ricardo@marliere.net>,
	Erick Shepherd <erick.shepherd@ni.com>
Subject: [RFC PATCH V2 2/2] mmc: allow card to disable tuning
Date: Thu, 6 Feb 2025 15:08:35 -0600	[thread overview]
Message-ID: <20250206210835.2980500-2-erick.shepherd@ni.com> (raw)
In-Reply-To: <20250206210835.2980500-1-erick.shepherd@ni.com>

Add a new field to the mmc_card struct to disable tuning for the card.
Currently the new field only gets set when a DDR50 card fails to tune,
which indicates the card does not support tuning.

Signed-off-by: Erick Shepherd <erick.shepherd@ni.com>
---
 drivers/mmc/core/core.c  | 3 +++
 drivers/mmc/core/sd.c    | 1 +
 include/linux/mmc/card.h | 1 +
 3 files changed, 5 insertions(+)

diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 5241528f8b90..ee91d53c45d5 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -934,6 +934,9 @@ int mmc_execute_tuning(struct mmc_card *card)
 	u32 opcode;
 	int err;
 
+	if (card->disable_tuning)
+		return 0;
+
 	if (!host->ops->execute_tuning)
 		return 0;
 
diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c
index cc757b850e79..dd65485c61d8 100644
--- a/drivers/mmc/core/sd.c
+++ b/drivers/mmc/core/sd.c
@@ -676,6 +676,7 @@ static int mmc_sd_init_uhs_card(struct mmc_card *card)
 		if (err && card->host->ios.timing == MMC_TIMING_UHS_DDR50) {
 			pr_warn("%s: ddr50 tuning failed\n",
 				mmc_hostname(card->host));
+			card->disable_tuning = true;
 			err = 0;
 		}
 	}
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h
index 526fce581657..f9733c7ce430 100644
--- a/include/linux/mmc/card.h
+++ b/include/linux/mmc/card.h
@@ -332,6 +332,7 @@ struct mmc_card {
 
 	bool			written_flag;	/* Indicates eMMC has been written since power on */
 	bool			reenable_cmdq;	/* Re-enable Command Queue */
+	bool			disable_tuning;	/* Disables tuning for the card */
 
 	unsigned int		erase_size;	/* erase size in sectors */
  	unsigned int		erase_shift;	/* if erase unit is power 2 */
-- 
2.43.0


  reply	other threads:[~2025-02-06 21:10 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-06 21:08 [RFC PATCH V2 1/2] mmc: Update sdhci tune function to return errors Erick Shepherd
2025-02-06 21:08 ` Erick Shepherd [this message]
2025-02-15  1:08   ` [RFC PATCH V2 2/2] mmc: allow card to disable tuning Adrian Hunter
2025-02-18 18:41     ` Erick Shepherd
2025-03-06 14:01       ` Adrian Hunter
2025-03-07 17:45         ` Erick Shepherd
2025-03-07 18:44           ` Adrian Hunter
2025-03-07 21:17             ` Erick Shepherd
2025-03-11 15:20               ` Adrian Hunter
2025-03-13 16:32                 ` Erick Shepherd
2025-02-06 22:34 ` [RFC PATCH V2 1/2] mmc: Update sdhci tune function to return errors Ricardo B. Marlière
2025-02-15  1:05 ` Adrian Hunter
2025-02-18 18:41   ` Erick Shepherd

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=20250206210835.2980500-2-erick.shepherd@ni.com \
    --to=erick.shepherd@ni.com \
    --cc=adrian.hunter@intel.com \
    --cc=andy-ld.lu@mediatek.com \
    --cc=avri.altman@wdc.com \
    --cc=cw9316.lee@samsung.com \
    --cc=dsimic@manjaro.org \
    --cc=keita.aihara@sony.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=quic_jjohnson@quicinc.com \
    --cc=ricardo@marliere.net \
    --cc=ulf.hansson@linaro.org \
    --cc=victor.shih@genesyslogic.com.tw \
    --cc=wsa+renesas@sang-engineering.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox