Linux MultiMedia Card development
 help / color / mirror / Atom feed
From: Erick Shepherd <erick.shepherd@ni.com>
To: <adrian.hunter@intel.com>
Cc: <andy-ld.lu@mediatek.com>, <avri.altman@wdc.com>,
	<cw9316.lee@samsung.com>, <dsimic@manjaro.org>,
	<erick.shepherd@ni.com>, <keita.aihara@sony.com>,
	<linux-kernel@vger.kernel.org>, <linux-mmc@vger.kernel.org>,
	<quic_jjohnson@quicinc.com>, <ricardo@marliere.net>,
	<ulf.hansson@linaro.org>, <victor.shih@genesyslogic.com.tw>,
	<wsa+renesas@sang-engineering.com>
Subject: Re: [RFC PATCH V2 2/2] mmc: allow card to disable tuning
Date: Thu, 13 Mar 2025 11:32:23 -0500	[thread overview]
Message-ID: <20250313163223.1514010-1-erick.shepherd@ni.com> (raw)
In-Reply-To: <65238f8f-46b8-41f2-a992-0d1a150ae8c1@intel.com>

How does this look? I confirmed the changes stop the card from tuning
and prevent the I/O errors. I can submit a new patch since these
changes are substantially different than my initial ones.

diff --git a/drivers/mmc/core/card.h b/drivers/mmc/core/card.h
index 3205feb1e8ff..756f80024635 100644
--- a/drivers/mmc/core/card.h
+++ b/drivers/mmc/core/card.h
@@ -89,6 +89,7 @@ struct mmc_fixup {
 #define CID_MANFID_MICRON       0x13
 #define CID_MANFID_SAMSUNG      0x15
 #define CID_MANFID_APACER       0x27
+#define CID_MANFID_SWISSBIT     0x5D
 #define CID_MANFID_KINGSTON     0x70
 #define CID_MANFID_HYNIX	0x90
 #define CID_MANFID_KINGSTON_SD	0x9F


diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 5241528f8b90..8962992f05aa 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -937,6 +937,10 @@ int mmc_execute_tuning(struct mmc_card *card)
 	if (!host->ops->execute_tuning)
 		return 0;
 
+	if ((card->quirks & MMC_QUIRK_NO_UHS_DDR50_TUNING) &&
+	    host->ios.timing == MMC_TIMING_UHS_DDR50)
+		return 0;
+
 	if (host->cqe_on)
 		host->cqe_ops->cqe_off(host);

 
diff --git a/drivers/mmc/core/quirks.h b/drivers/mmc/core/quirks.h
index 89b512905be1..7f893bafaa60 100644
--- a/drivers/mmc/core/quirks.h
+++ b/drivers/mmc/core/quirks.h
@@ -34,6 +34,16 @@ static const struct mmc_fixup __maybe_unused mmc_sd_fixups[] = {
 		   MMC_QUIRK_BROKEN_SD_CACHE | MMC_QUIRK_BROKEN_SD_POWEROFF_NOTIFY,
 		   EXT_CSD_REV_ANY),
 
+	/*
+	 * Swissbit series S46-u cards throw I/O errors during tuning requests
+	 * after the initial tuning request expectedly times out. This has
+	 * only been observed on cards manufactured on 01/2019 that are using
+	 * Bay Trail host controllers.
+	 */
+	_FIXUP_EXT("0016G", CID_MANFID_SWISSBIT, 0x5342, 2019, 1,
+		   0, -1ull, SDIO_ANY_ID, SDIO_ANY_ID, add_quirk_sd,
+		   MMC_QUIRK_NO_UHS_DDR50_TUNING, EXT_CSD_REV_ANY),
+
 	END_FIXUP
 };

 
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h
index 526fce581657..ddcdf23d731c 100644
--- a/include/linux/mmc/card.h
+++ b/include/linux/mmc/card.h
@@ -329,6 +329,7 @@ struct mmc_card {
 #define MMC_QUIRK_BROKEN_SD_CACHE	(1<<15)	/* Disable broken SD cache support */
 #define MMC_QUIRK_BROKEN_CACHE_FLUSH	(1<<16)	/* Don't flush cache until the write has occurred */
 #define MMC_QUIRK_BROKEN_SD_POWEROFF_NOTIFY	(1<<17) /* Disable broken SD poweroff notify support */
+#define MMC_QUIRK_NO_UHS_DDR50_TUNING	(1<<18) /* Disable DDR50 tuning */
 
 	bool			written_flag;	/* Indicates eMMC has been written since power on */
 	bool			reenable_cmdq;	/* Re-enable Command Queue */
-- 

Regards,
Erick

  reply	other threads:[~2025-03-13 16:33 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 ` [RFC PATCH V2 2/2] mmc: allow card to disable tuning Erick Shepherd
2025-02-15  1:08   ` 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 [this message]
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=20250313163223.1514010-1-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