Skip to content

Commit a7f92a6

Browse files
mmc: Add quirk to disable DDR50 tuning
Adds the MMC_QUIRK_NO_UHS_DDR50_TUNING quirk and updates mmc_execute_tuning() to return 0 if that quirk is set. This fixes an issue on certain Swissbit SD cards that do not support DDR50 tuning where tuning requests caused I/O errors to be thrown. Signed-off-by: Erick Shepherd <[email protected]>
1 parent 3635a20 commit a7f92a6

File tree

4 files changed

+14
-0
lines changed

4 files changed

+14
-0
lines changed

drivers/mmc/core/card.h

+1
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ struct mmc_fixup {
8686
#define CID_MANFID_MICRON 0x13
8787
#define CID_MANFID_SAMSUNG 0x15
8888
#define CID_MANFID_APACER 0x27
89+
#define CID_MANFID_SWISSBIT 0x5D
8990
#define CID_MANFID_KINGSTON 0x70
9091
#define CID_MANFID_HYNIX 0x90
9192
#define CID_MANFID_KINGSTON_SD 0x9F

drivers/mmc/core/core.c

+4
Original file line numberDiff line numberDiff line change
@@ -931,6 +931,10 @@ int mmc_execute_tuning(struct mmc_card *card)
931931
if (!host->ops->execute_tuning)
932932
return 0;
933933

934+
if ((card->quirks & MMC_QUIRK_NO_UHS_DDR50_TUNING) &&
935+
host->ios.timing == MMC_TIMING_UHS_DDR50)
936+
return 0;
937+
934938
if (host->cqe_on)
935939
host->cqe_ops->cqe_off(host);
936940

drivers/mmc/core/quirks.h

+8
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@ static const struct mmc_fixup __maybe_unused mmc_sd_fixups[] = {
3434
MMC_QUIRK_BROKEN_SD_CACHE | MMC_QUIRK_BROKEN_SD_POWEROFF_NOTIFY,
3535
EXT_CSD_REV_ANY),
3636

37+
/*
38+
* Certain DDR50 Swissbit SD cards built to the 3.0 SD spec, which
39+
* do not support tuning, throw I/O errors during tuning requests.
40+
* This has only been observed on Bay Trail host controllers.
41+
*/
42+
MMC_FIXUP("0016G", CID_MANFID_SWISSBIT, 0x5342, add_quirk,
43+
MMC_QUIRK_NO_UHS_DDR50_TUNING),
44+
3745
END_FIXUP
3846
};
3947

include/linux/mmc/card.h

+1
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@ struct mmc_card {
297297
#define MMC_QUIRK_BROKEN_SD_CACHE (1<<15) /* Disable broken SD cache support */
298298
#define MMC_QUIRK_BROKEN_CACHE_FLUSH (1<<16) /* Don't flush cache until the write has occurred */
299299
#define MMC_QUIRK_BROKEN_SD_POWEROFF_NOTIFY (1<<17) /* Disable broken SD poweroff notify support */
300+
#define MMC_QUIRK_NO_UHS_DDR50_TUNING (1<<18) /* Disable DDR50 tuning */
300301

301302
bool written_flag; /* Indicates eMMC has been written since power on */
302303
bool reenable_cmdq; /* Re-enable Command Queue */

0 commit comments

Comments
 (0)