summaryrefslogtreecommitdiff
path: root/drivers/mmc/core/card.h
diff options
context:
space:
mode:
authorAvri Altman <avri.altman@wdc.com>2022-09-28 12:57:44 +0300
committerUlf Hansson <ulf.hansson@linaro.org>2022-10-06 14:31:13 +0300
commit07d2872bf4c864eb83d034263c155746a2fb7a3b (patch)
tree863c65d136afe4b08c082e4beddeb82b1158684f /drivers/mmc/core/card.h
parent833477fce7a14d43ae4c07f8ddc32fa5119471a2 (diff)
downloadlinux-07d2872bf4c864eb83d034263c155746a2fb7a3b.tar.xz
mmc: core: Add SD card quirk for broken discard
Some SD-cards from Sandisk that are SDA-6.0 compliant reports they supports discard, while they actually don't. This might cause mk2fs to fail while trying to format the card and revert it to a read-only mode. To fix this problem, let's add a card quirk (MMC_QUIRK_BROKEN_SD_DISCARD) to indicate that we shall fall-back to use the legacy erase command instead. Signed-off-by: Avri Altman <avri.altman@wdc.com> Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220928095744.16455-1-avri.altman@wdc.com [Ulf: Updated the commit message] Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc/core/card.h')
-rw-r--r--drivers/mmc/core/card.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/mmc/core/card.h b/drivers/mmc/core/card.h
index 99045e138ba4..cfdd1ff40b86 100644
--- a/drivers/mmc/core/card.h
+++ b/drivers/mmc/core/card.h
@@ -73,6 +73,7 @@ struct mmc_fixup {
#define EXT_CSD_REV_ANY (-1u)
#define CID_MANFID_SANDISK 0x2
+#define CID_MANFID_SANDISK_SD 0x3
#define CID_MANFID_ATP 0x9
#define CID_MANFID_TOSHIBA 0x11
#define CID_MANFID_MICRON 0x13
@@ -258,4 +259,9 @@ static inline int mmc_card_broken_hpi(const struct mmc_card *c)
return c->quirks & MMC_QUIRK_BROKEN_HPI;
}
+static inline int mmc_card_broken_sd_discard(const struct mmc_card *c)
+{
+ return c->quirks & MMC_QUIRK_BROKEN_SD_DISCARD;
+}
+
#endif