summaryrefslogtreecommitdiff
path: root/drivers/mmc/core/quirks.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 13:31:13 +0200
commit07d2872bf4c864eb83d034263c155746a2fb7a3b (patch)
tree863c65d136afe4b08c082e4beddeb82b1158684f /drivers/mmc/core/quirks.h
parent833477fce7a14d43ae4c07f8ddc32fa5119471a2 (diff)
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/quirks.h')
-rw-r--r--drivers/mmc/core/quirks.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/mmc/core/quirks.h b/drivers/mmc/core/quirks.h
index be4393988086..29b9497936df 100644
--- a/drivers/mmc/core/quirks.h
+++ b/drivers/mmc/core/quirks.h
@@ -100,6 +100,12 @@ static const struct mmc_fixup __maybe_unused mmc_blk_fixups[] = {
MMC_FIXUP("V10016", CID_MANFID_KINGSTON, CID_OEMID_ANY, add_quirk_mmc,
MMC_QUIRK_TRIM_BROKEN),
+ /*
+ * Some SD cards reports discard support while they don't
+ */
+ MMC_FIXUP(CID_NAME_ANY, CID_MANFID_SANDISK_SD, 0x5344, add_quirk_sd,
+ MMC_QUIRK_BROKEN_SD_DISCARD),
+
END_FIXUP
};