aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/mmc/core/host.c5
-rw-r--r--drivers/mmc/core/quirks.c13
-rw-r--r--include/linux/mmc/card.h1
3 files changed, 15 insertions, 4 deletions
diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c
index b3ac6c5bc5c6..461e6a17fb90 100644
--- a/drivers/mmc/core/host.c
+++ b/drivers/mmc/core/host.c
@@ -160,10 +160,7 @@ static bool mmc_host_may_gate_card(struct mmc_card *card)
160 * gate the clock, because there is somebody out there that may still 160 * gate the clock, because there is somebody out there that may still
161 * be using it. 161 * be using it.
162 */ 162 */
163 if (mmc_card_sdio(card)) 163 return !(card->quirks & MMC_QUIRK_BROKEN_CLK_GATING);
164 return false;
165
166 return true;
167} 164}
168 165
169/** 166/**
diff --git a/drivers/mmc/core/quirks.c b/drivers/mmc/core/quirks.c
index e18cb49c12b1..890843129e3b 100644
--- a/drivers/mmc/core/quirks.c
+++ b/drivers/mmc/core/quirks.c
@@ -40,7 +40,20 @@ static void __maybe_unused remove_quirk(struct mmc_card *card, int data)
40 card->quirks &= ~data; 40 card->quirks &= ~data;
41} 41}
42 42
43/*
44 * This hook just adds a quirk for all sdio devices
45 */
46static void add_quirk_for_sdio_devices(struct mmc_card *card, int data)
47{
48 if (mmc_card_sdio(card))
49 card->quirks |= data;
50}
51
43static const struct mmc_fixup mmc_fixup_methods[] = { 52static const struct mmc_fixup mmc_fixup_methods[] = {
53 /* by default sdio devices are considered CLK_GATING broken */
54 /* good cards will be whitelisted as they are tested */
55 { SDIO_ANY_ID, SDIO_ANY_ID,
56 add_quirk_for_sdio_devices, MMC_QUIRK_BROKEN_CLK_GATING }
44 { 0 } 57 { 0 }
45}; 58};
46 59
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h
index ad7413854f79..adb4888248be 100644
--- a/include/linux/mmc/card.h
+++ b/include/linux/mmc/card.h
@@ -124,6 +124,7 @@ struct mmc_card {
124 /* for byte mode */ 124 /* for byte mode */
125#define MMC_QUIRK_NONSTD_SDIO (1<<2) /* non-standard SDIO card attached */ 125#define MMC_QUIRK_NONSTD_SDIO (1<<2) /* non-standard SDIO card attached */
126 /* (missing CIA registers) */ 126 /* (missing CIA registers) */
127#define MMC_QUIRK_BROKEN_CLK_GATING (1<<3) /* clock gating the sdio bus will make card fail */
127 128
128 unsigned int erase_size; /* erase size in sectors */ 129 unsigned int erase_size; /* erase size in sectors */
129 unsigned int erase_shift; /* if erase unit is power 2 */ 130 unsigned int erase_shift; /* if erase unit is power 2 */