Skip to content

Commit 009c3a4

Browse files
avri-altman-sndkstorulf
authored andcommitted
mmc: core: sd: Apply BROKEN_SD_DISCARD quirk earlier
Move the BROKEN_SD_DISCARD quirk for certain SanDisk SD cards from the `mmc_blk_fixups[]` to `mmc_sd_fixups[]`. This ensures the quirk is applied earlier in the device initialization process, aligning with the reasoning in [1]. Applying the quirk sooner prevents the kernel from incorrectly enabling discard support on affected cards during initial setup. [1] https://lore.kernel.org/all/[email protected] Fixes: 07d2872 ("mmc: core: Add SD card quirk for broken discard") Signed-off-by: Avri Altman <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ulf Hansson <[email protected]>
1 parent 19272b3 commit 009c3a4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

drivers/mmc/core/quirks.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ static const struct mmc_fixup __maybe_unused mmc_sd_fixups[] = {
4444
0, -1ull, SDIO_ANY_ID, SDIO_ANY_ID, add_quirk_sd,
4545
MMC_QUIRK_NO_UHS_DDR50_TUNING, EXT_CSD_REV_ANY),
4646

47+
/*
48+
* Some SD cards reports discard support while they don't
49+
*/
50+
MMC_FIXUP(CID_NAME_ANY, CID_MANFID_SANDISK_SD, 0x5344, add_quirk_sd,
51+
MMC_QUIRK_BROKEN_SD_DISCARD),
52+
4753
END_FIXUP
4854
};
4955

@@ -147,12 +153,6 @@ static const struct mmc_fixup __maybe_unused mmc_blk_fixups[] = {
147153
MMC_FIXUP("M62704", CID_MANFID_KINGSTON, 0x0100, add_quirk_mmc,
148154
MMC_QUIRK_TRIM_BROKEN),
149155

150-
/*
151-
* Some SD cards reports discard support while they don't
152-
*/
153-
MMC_FIXUP(CID_NAME_ANY, CID_MANFID_SANDISK_SD, 0x5344, add_quirk_sd,
154-
MMC_QUIRK_BROKEN_SD_DISCARD),
155-
156156
END_FIXUP
157157
};
158158

0 commit comments

Comments
 (0)