Skip to content

Commit 84ee19b

Browse files
avri-altman-sndkstorulf
authored andcommitted
mmc: core: Capture correct oemid-bits for eMMC cards
The OEMID is an 8-bit binary number rather than 16-bit as the current code parses for. The OEMID occupies bits [111:104] in the CID register, see the eMMC spec JESD84-B51 paragraph 7.2.3. It seems that the 16-bit comes from the legacy MMC specs (v3.31 and before). Let's fix the parsing by simply move to use 8-bit instead of 16-bit. This means we ignore the impact on some of those old MMC cards that may be out there, but on the other hand this shouldn't be a problem as the OEMID seems not be an important feature for these cards. 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 c7bb120 commit 84ee19b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/mmc/core/mmc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ static int mmc_decode_cid(struct mmc_card *card)
104104
case 3: /* MMC v3.1 - v3.3 */
105105
case 4: /* MMC v4 */
106106
card->cid.manfid = UNSTUFF_BITS(resp, 120, 8);
107-
card->cid.oemid = UNSTUFF_BITS(resp, 104, 16);
107+
card->cid.oemid = UNSTUFF_BITS(resp, 104, 8);
108108
card->cid.prod_name[0] = UNSTUFF_BITS(resp, 96, 8);
109109
card->cid.prod_name[1] = UNSTUFF_BITS(resp, 88, 8);
110110
card->cid.prod_name[2] = UNSTUFF_BITS(resp, 80, 8);

0 commit comments

Comments
 (0)