From: Peter Korsgaard <peter@korsgaard.com>
To: linux-mmc@vger.kernel.org, Avri Altman <avri.altman@wdc.com>,
Ulf Hansson <ulf.hansson@linaro.org>
Cc: Peter Korsgaard <peter@korsgaard.com>
Subject: [PATCH 1/2] mmc-utils: lsmmc.c: print_mmc_cid(): correct year/month parsing
Date: Tue, 4 Nov 2025 21:00:07 +0100 [thread overview]
Message-ID: <20251104200008.940057-1-peter@korsgaard.com> (raw)
The parsing logic for the MMC manufacturing date had the year and month
swapped. From JESD84:
The manufacturing date, MDT, is composed of two hexadecimal digits, four
bits each, representing a two digits date code m/y; The “m” field, most
significant nibble, is the month code. 1 = January. The “y” field, least
significant nibble, is the year code.
Notice that this is the opposite of the SD bit ordering.
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
lsmmc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lsmmc.c b/lsmmc.c
index 799e1ea..7331c1b 100644
--- a/lsmmc.c
+++ b/lsmmc.c
@@ -589,7 +589,7 @@ static void print_mmc_cid(struct config *config, char *cid)
parse_bin(cid, "8u6r2u8u48a4u4u32u4u4u7u1r",
&mid, &cbx, &oid, &pnm[0], &prv_major, &prv_minor, &psn,
- &mdt_year, &mdt_month, &crc);
+ &mdt_month, &mdt_year, &crc);
pnm[6] = '\0';
--
2.39.5
next reply other threads:[~2025-11-04 20:00 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-04 20:00 Peter Korsgaard [this message]
2025-11-04 20:00 ` [PATCH 2/2] mmc-utils: lsmmc.c: print_{mmc,sd}_cid(): correct month names Peter Korsgaard
2025-11-11 17:36 ` Ulf Hansson
2025-11-05 2:04 ` [PATCH 1/2] mmc-utils: lsmmc.c: print_mmc_cid(): correct year/month parsing Shawn Lin
2025-11-05 6:56 ` Peter Korsgaard
2025-11-05 7:07 ` Peter Korsgaard
2025-11-05 7:23 ` Shawn Lin
2025-11-05 19:57 ` Avri Altman
2025-11-05 20:16 ` Peter Korsgaard
2025-11-07 1:39 ` Shawn Lin
2025-11-11 17:26 ` Ulf Hansson
2025-11-11 17:36 ` Ulf Hansson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251104200008.940057-1-peter@korsgaard.com \
--to=peter@korsgaard.com \
--cc=avri.altman@wdc.com \
--cc=linux-mmc@vger.kernel.org \
--cc=ulf.hansson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox