diff options
author | Adrian Hunter <adrian.hunter@nokia.com> | 2010-03-23 16:35:40 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-24 19:31:21 -0400 |
commit | 7198f3c9b13c7aa1e5d9f7ff74c0ea303174feff (patch) | |
tree | 506065ad0752685ec1ac0a164e294bd85cb9bbb9 /drivers/mmc | |
parent | 3f8b5ee33293d43ca360771b535dfae8c57259dc (diff) |
mmc: fix incorrect interpretation of card type bits
In the extended CSD register the CARD_TYPE is an 8-bit value of which the
upper 6 bits were reserved in JEDEC specifications prior to version 4.4.
In version 4.4 two of the reserved bits were designated for identifying
support for the newly added High-Speed Dual Data Rate. Unfortunately the
mmc_read_ext_csd() function required that the reserved bits be zero
instead of ignoring them as it should.
This patch makes mmc_read_ext_csd() ignore the CARD_TYPE bits that are
reserved or not yet supported. It also stops the function jumping to the
end as though an error occurred, when it is only warns that the CARD_TYPE
bits (that it does interpret) are invalid.
Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com>
Cc: <linux-mmc@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | drivers/mmc/core/mmc.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index 0eac6c814904..e041c003db22 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c | |||
@@ -225,7 +225,7 @@ static int mmc_read_ext_csd(struct mmc_card *card) | |||
225 | mmc_card_set_blockaddr(card); | 225 | mmc_card_set_blockaddr(card); |
226 | } | 226 | } |
227 | 227 | ||
228 | switch (ext_csd[EXT_CSD_CARD_TYPE]) { | 228 | switch (ext_csd[EXT_CSD_CARD_TYPE] & EXT_CSD_CARD_TYPE_MASK) { |
229 | case EXT_CSD_CARD_TYPE_52 | EXT_CSD_CARD_TYPE_26: | 229 | case EXT_CSD_CARD_TYPE_52 | EXT_CSD_CARD_TYPE_26: |
230 | card->ext_csd.hs_max_dtr = 52000000; | 230 | card->ext_csd.hs_max_dtr = 52000000; |
231 | break; | 231 | break; |
@@ -237,7 +237,6 @@ static int mmc_read_ext_csd(struct mmc_card *card) | |||
237 | printk(KERN_WARNING "%s: card is mmc v4 but doesn't " | 237 | printk(KERN_WARNING "%s: card is mmc v4 but doesn't " |
238 | "support any high-speed modes.\n", | 238 | "support any high-speed modes.\n", |
239 | mmc_hostname(card->host)); | 239 | mmc_hostname(card->host)); |
240 | goto out; | ||
241 | } | 240 | } |
242 | 241 | ||
243 | if (card->ext_csd.rev >= 3) { | 242 | if (card->ext_csd.rev >= 3) { |