mmc: core: Extend manufacturing date beyond 2025
v2 cover mmc: core: Extend manufacturing date beyond 2025
Hi Ulf,
This patch series addresses the upcoming exhaustion of the eMMC manufacturing date (MDT) year field, which is limited to a 4-bit value in the CID register. Under the current standard (EXT_CSD_REV=8), the representable years end in 2025.
The first patch implements the recently approved JEDEC standard update for EXT_CSD_REV=9. This update rolls over the 4-bit year codes to cover a new 16-year period, extending the range up to 2038.
The second patch introduces a quirk to handle vendor-specific behavior. Some eMMC vendors are not yet updating their devices to EXT_CSD_REV=9 but still need to report manufacturing dates for 2026 and beyond. These devices re-purpose the year codes for 2010-2012 to represent 2026-2028.
Thanks,
Avri
---
Changes in v2:
- move the fixup to mmc_ext_csd_fixups
- State the correct spec release
- Fixed a typo in the commit message of the second patch.
---
Avri Altman (2):
mmc: core: Adjust MDT beyond 2025
mmc: core: Add quirk for incorrect manufacturing date
drivers/mmc/core/card.h | 6 ++++++ drivers/mmc/core/mmc.c | 12 ++++++++++++ drivers/mmc/core/quirks.h | 3 +++ include/linux/mmc/card.h | 1 + 4 files changed, 22 insertions(+)
Signature · 1 line
2.34.1
PATCH v2 1/2 mmc: core: Adjust MDT beyond 2025
JEDEC JESD84-B51B which was released in September 2025, increases the manufacturing year limit for eMMC devices. The eMMC manufacturing year is stored in a 4-bit field in the CID register. Originally, it covered 1997–2012. Later, with EXT_CSD_REV=8, it was extended up to 2025. Now, with EXT_CSD_REV=9, the range is rolled over by another 16 years, up to 2038.
The mapping is as follows:
cid[8..11] | rev ≤ 4 | 8 ≥ rev > 4 | rev > 8
---------------------------------------------
0 | 1997 | 2013 | 2029 1 | 1998 | 2014 | 2030 2 | 1999 | 2015 | 2031 3 | 2000 | 2016 | 2032 4 | 2001 | 2017 | 2033 5 | 2002 | 2018 | 2034 6 | 2003 | 2019 | 2035 7 | 2004 | 2020 | 2036 8 | 2005 | 2021 | 2037 9 | 2006 | 2022 | 2038 10 | 2007 | 2023 | 11 | 2008 | 2024 | 12 | 2009 | 2025 | 13 | 2010 | | 2026 14 | 2011 | | 2027 15 | 2012 | | 2028
--- drivers/mmc/core/mmc.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/mmc/core/mmc.c +7 -0
@@ -671,7 +671,14 @@ static int mmc_decode_ext_csd(struct mmc_card *card, u8 *ext_csd) card->ext_csd.enhanced_rpmb_supported = (card->ext_csd.rel_param &EXT_CSD_WR_REL_PARAM_EN_RPMB_REL_WR ); + +if (card->ext_csd.rev >=9 ) { +/* Adjust production date as per JEDEC JESD84-B51B September 2025 */ +if (card->cid.year <2023 ) + card->cid.year +=16 ; + } } + out:return err; }
Signature · 1 line
2.34.1
PATCH v2 2/2 mmc: core: Add quirk for incorrect manufacturing date
In reply to Avri AltmanSome eMMC vendors need to report manufacturing dates beyond 2025 but are reluctant to update the EXT_CSD revision from 8 to 9. Changing the Updating the EXT_CSD revision may involve additional testing or qualification steps with customers. To ease this transition and avoid a full re-qualification process, a workaround is needed. This patch introduces a temporary quirk that re-purposes the year codes corresponding to 2010, 2011, and 2012 to represent the years 2026, 2027, and 2028, respectively. This solution is only valid for this three-year period.
After 2028, vendors must update their firmware to set EXT_CSD_REV=9 to continue reporting the correct manufacturing date in compliance with the JEDEC standard.
The MMC_QUIRK_BROKEN_MDT is introduced and enabled for all Sandisk devices to handle this behavior.
--- drivers/mmc/core/card.h | 6 ++++++ drivers/mmc/core/mmc.c | 5 +++++ drivers/mmc/core/quirks.h | 3 +++ include/linux/mmc/card.h | 1 + 4 files changed, 15 insertions(+)
drivers/mmc/core/card.h +6 -0
@@ -89,6 +89,7 @@ struct mmc_fixup {#define CID_MANFID_MICRON 0x13#define CID_MANFID_SAMSUNG 0x15#define CID_MANFID_APACER 0x27 +#define CID_MANFID_SANDISK_MMC 0x45#define CID_MANFID_SWISSBIT 0x5D#define CID_MANFID_KINGSTON 0x70#define CID_MANFID_HYNIX 0x90
@@ -305,4 +306,9 @@ static inline int mmc_card_no_uhs_ddr50_tuning(const struct mmc_card *c) return c->quirks & MMC_QUIRK_NO_UHS_DDR50_TUNING; } +static inline int mmc_card_broken_mdt (const struct mmc_card *c) +{ +return c->quirks &MMC_QUIRK_BROKEN_MDT ; +} +#endif
drivers/mmc/core/mmc.c +5 -0
@@ -676,6 +676,11 @@ static int mmc_decode_ext_csd(struct mmc_card *card, u8 *ext_csd)/* Adjust production date as per JEDEC JESD84-B51B September 2025 */ if (card->cid.year <2023 ) card->cid.year +=16 ; + }else { +/* Handle vendors with broken MDT reporting */ +if (mmc_card_broken_mdt (card) && card->cid.year >=2010 && + card->cid.year <=2012 ) + card->cid.year +=16 ; } }
drivers/mmc/core/quirks.h +3 -0
@@ -170,6 +170,9 @@ static const struct mmc_fixup __maybe_unused mmc_ext_csd_fixups[] = {MMC_FIXUP_EXT_CSD_REV (CID_NAME_ANY ,CID_MANFID_NUMONYX ,0x014e , add_quirk,MMC_QUIRK_BROKEN_HPI ,6 ), +MMC_FIXUP (CID_NAME_ANY ,CID_MANFID_SANDISK_MMC ,CID_OEMID_ANY , add_quirk_mmc, +MMC_QUIRK_BROKEN_MDT ), + END_FIXUP };
include/linux/mmc/card.h +1 -0
@@ -329,6 +329,7 @@ struct mmc_card {#define MMC_QUIRK_BROKEN_CACHE_FLUSH (1<<16)/* Don't flush cache until the write has occurred */ #define MMC_QUIRK_BROKEN_SD_POWEROFF_NOTIFY (1<<17)/* Disable broken SD poweroff notify support */ #define MMC_QUIRK_NO_UHS_DDR50_TUNING (1<<18)/* Disable DDR50 tuning */ +#define MMC_QUIRK_BROKEN_MDT (1<<19)/* Wrong manufacturing year */ bool written_flag;/* Indicates eMMC has been written since power on */ bool reenable_cmdq;/* Re-enable Command Queue */
Signature · 1 line
2.34.1
Quoted 6 lines
Hi Ulf,
This patch series addresses the upcoming exhaustion of the eMMC manufacturing date (MDT) year field, which is limited to a 4-bit value in the CID register. Under the current standard (EXT_CSD_REV=8), the representable years end in 2025.
Quoted 8 lines
The first patch implements the recently approved JEDEC standard update for EXT_CSD_REV=9. This update rolls over the 4-bit year codes to cover a new 16- year period, extending the range up to 2038.
The second patch introduces a quirk to handle vendor-specific behavior. Some eMMC vendors are not yet updating their devices to EXT_CSD_REV=9 but still need to report manufacturing dates for 2026 and beyond. These devices re- purpose the year codes for 2010-2012 to represent 2026-2028.
Ulf hi,
Would appreciate if you could look at this before year end.
Thanks,
Avri
Quoted 23 lines
Thanks,
Avri---
Changes in v2:
- move the fixup tommc_ext_csd_fixups
- State the correct spec release
- Fixed a typo in the commit message of the second patch.
---Avri Altman (2):
mmc: core: Adjust MDT beyond 2025
mmc: core: Add quirk for incorrect manufacturing datedrivers/mmc/core/card.h | 6 ++++++ drivers/mmc/core/mmc.c | 12 ++++++++++++ drivers/mmc/core/quirks.h | 3 +++ include/linux/mmc/card.h | 1 + 4 files changed, 22 insertions(+)--
2.34.1
Quoted 11 lines · Avri Altman
Quoted 11 lines
Hi Ulf,
This patch series addresses the upcoming exhaustion of the eMMC manufacturing date (MDT) year field, which is limited to a 4-bit value in the CID register. Under the current standard (EXT_CSD_REV=8), the representable years end in 2025.
The first patch implements the recently approved JEDEC standard update for EXT_CSD_REV=9. This update rolls over the 4-bit year codes to cover a new 16- year period, extending the range up to 2038.
Quoted 6 lines
Quoted 4 lines
The second patch introduces a quirk to handle vendor-specific behavior. Some eMMC vendors are not yet updating their devices to EXT_CSD_REV=9 but still need to report manufacturing dates for 2026 and beyond. These devices re- purpose the year codes for 2010-2012 to represent 2026-2028.
Ulf hi,
Would appreciate if you could look at this before year end.
The series looks good to me. I will apply it as soon as we have the v6.19-rc1.
[...]
Kind regards
Uffe
Ulf Hansson
AppliedQuoted 31 lines · Avri Altman
Hi Ulf,
This patch series addresses the upcoming exhaustion of the eMMC manufacturing date (MDT) year field, which is limited to a 4-bit value in the CID register. Under the current standard (EXT_CSD_REV=8), the representable years end in 2025.
The first patch implements the recently approved JEDEC standard update for EXT_CSD_REV=9. This update rolls over the 4-bit year codes to cover a new 16-year period, extending the range up to 2038.
The second patch introduces a quirk to handle vendor-specific behavior. Some eMMC vendors are not yet updating their devices to EXT_CSD_REV=9 but still need to report manufacturing dates for 2026 and beyond. These devices re-purpose the year codes for 2010-2012 to represent 2026-2028.
Thanks,
Avri---
Changes in v2:
- move the fixup tommc_ext_csd_fixups
- State the correct spec release
- Fixed a typo in the commit message of the second patch.
---Avri Altman (2):
mmc: core: Adjust MDT beyond 2025
mmc: core: Add quirk for incorrect manufacturing date
Quoted 9 lines
drivers/mmc/core/card.h | 6 ++++++ drivers/mmc/core/mmc.c | 12 ++++++++++++ drivers/mmc/core/quirks.h | 3 +++ include/linux/mmc/card.h | 1 + 4 files changed, 22 insertions(+)--
2.34.1
I have applied the series for next, thanks!
However, I noticed that the author of the patch has your gmail-address and the sob has your sandisk-address. I guess we should change to your sandisk-address to be in both places, no?
Kind regards
Uffe
Quoted 5 lines
I have applied the series for next, thanks!
However, I noticed that the author of the patch has your gmail-address and the sob has your sandisk-address. I guess we should change to your sandisk-address to be in both places, no?
Yes. Sorry for missing this.
Thanks,
Avri
Quoted 3 lines
Kind regards
Uffe
Quoted 7 lines · Avri Altman
Quoted 6 lines
I have applied the series for next, thanks!
However, I noticed that the author of the patch has your gmail-address and the sob has your sandisk-address. I guess we should change to your sandisk-address to be in both places, no?
Yes. Sorry for missing this.
No worries, I have amended the commits accordingly.
Kind regards
Uffe