1 From c9b61d1d83073761871c7acba332216494e6f0bb Mon Sep 17 00:00:00 2001
2 From: Jonathan Bell <jonathan@raspberrypi.com>
3 Date: Mon, 8 Apr 2024 16:09:52 +0100
4 Subject: [PATCH 1260/1350] drivers: mmc: disable write-caching on Samsung 2023
7 Samsung EVO Plus, Pro Plus and Evo Ultimate cards of this era appear to
8 have a broken cache-flush implementation when operating in CQ mode.
10 Unfortunately the cards seem to use a separate CID name string for every
11 variant and capacity, so nobble the cache feature for this MANFID, OEMID
12 and year. Turning this off seems to have negligible impact on
13 random-write throughput in non-CQ mode.
15 Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
17 drivers/mmc/core/card.h | 1 +
18 drivers/mmc/core/quirks.h | 8 ++++++++
19 2 files changed, 9 insertions(+)
21 --- a/drivers/mmc/core/card.h
22 +++ b/drivers/mmc/core/card.h
23 @@ -84,6 +84,7 @@ struct mmc_fixup {
24 #define CID_MANFID_TOSHIBA 0x11
25 #define CID_MANFID_MICRON 0x13
26 #define CID_MANFID_SAMSUNG 0x15
27 +#define CID_MANFID_SAMSUNG_SD 0x1b
28 #define CID_MANFID_APACER 0x27
29 #define CID_MANFID_KINGSTON 0x70
30 #define CID_MANFID_HYNIX 0x90
31 --- a/drivers/mmc/core/quirks.h
32 +++ b/drivers/mmc/core/quirks.h
33 @@ -25,6 +25,14 @@ static const struct mmc_fixup __maybe_un
34 0, -1ull, SDIO_ANY_ID, SDIO_ANY_ID, add_quirk_sd,
35 MMC_QUIRK_BROKEN_SD_CACHE, EXT_CSD_REV_ANY),
38 + * Samsung Pro Plus/EVO Plus/Pro Ultimate SD cards (2023) claim to cache
39 + * flush OK, but become unresponsive afterwards.
41 + _FIXUP_EXT(CID_NAME_ANY, CID_MANFID_SAMSUNG_SD, 0x534d, 2023, CID_MONTH_ANY,
42 + 0, -1ull, SDIO_ANY_ID, SDIO_ANY_ID, add_quirk_sd,
43 + MMC_QUIRK_BROKEN_SD_CACHE, EXT_CSD_REV_ANY),