Skip to content

Commit cbcc07b

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 cbcc07b

File tree

4 files changed

+9
-0
lines changed

4 files changed

+9
-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

+3
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ 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+
MMC_FIXUP("0016G", CID_MANFID_SWISSBIT, 0x5342, add_quirk,
38+
MMC_QUIRK_NO_UHS_DDR50_TUNING),
39+
3740
END_FIXUP
3841
};
3942

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)