73a6b708567bd2376c8f8fe0d80995a90d2c2e79
[openwrt/staging/ldir.git] /
1 From 43730828eca754b4b527d79fc5a1d3ff50c50481 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 1019/1085] drivers: mmc: disable write-caching on Samsung 2023
5 model year SD cards
6
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.
9
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.
14
15 Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
16 ---
17 drivers/mmc/core/card.h | 1 +
18 drivers/mmc/core/quirks.h | 8 ++++++++
19 2 files changed, 9 insertions(+)
20
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),
36
37 + /*
38 + * Samsung Pro Plus/EVO Plus/Pro Ultimate SD cards (2023) claim to cache
39 + * flush OK, but become unresponsive afterwards.
40 + */
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),
44 +
45 END_FIXUP
46 };
47