Skip to content

Commit 91b2a63

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 91b2a63

File tree

4 files changed

+16
-0
lines changed

4 files changed

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

+10
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,16 @@ 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+
* Swissbit series S46-u cards throw I/O errors during tuning requests
39+
* after the initial tuning request expectedly times out. This has
40+
* only been observed on cards manufactured on 01/2019 that are using
41+
* Bay Trail host controllers.
42+
*/
43+
_FIXUP_EXT("0016G", CID_MANFID_SWISSBIT, 0x5342, 2019, 1,
44+
0, -1ull, SDIO_ANY_ID, SDIO_ANY_ID, add_quirk_sd,
45+
MMC_QUIRK_NO_UHS_DDR50_TUNING, EXT_CSD_REV_ANY),
46+
3747
END_FIXUP
3848
};
3949

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)