diff options
author | Hanumath Prasad <hanumath.prasad@stericsson.com> | 2010-08-10 21:01:45 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-11 11:59:03 -0400 |
commit | fc8a0985c2846292312556cba10b8a4182f55967 (patch) | |
tree | 951c4774239bd406271d18acd8574a76e1bbdea8 | |
parent | c1f5977c6a136acbf525c634c8511e19d0c1f195 (diff) |
mmc: only set blockaddressed for > 2GiB cards
A non-zero value of SEC_COUNT does not indicate that the card is sector
addressed. According to the MMC specification, cards with a density
greater than 2GiB are sector addressed.
Acked-by: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Hanumath Prasad <hanumath.prasad@stericsson.com>
Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.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>
-rw-r--r-- | drivers/mmc/core/mmc.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index cd8d3d2ea901..ccba3869c029 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c | |||
@@ -234,7 +234,9 @@ static int mmc_read_ext_csd(struct mmc_card *card) | |||
234 | ext_csd[EXT_CSD_SEC_CNT + 1] << 8 | | 234 | ext_csd[EXT_CSD_SEC_CNT + 1] << 8 | |
235 | ext_csd[EXT_CSD_SEC_CNT + 2] << 16 | | 235 | ext_csd[EXT_CSD_SEC_CNT + 2] << 16 | |
236 | ext_csd[EXT_CSD_SEC_CNT + 3] << 24; | 236 | ext_csd[EXT_CSD_SEC_CNT + 3] << 24; |
237 | if (card->ext_csd.sectors) | 237 | |
238 | /* Cards with density > 2GiB are sector addressed */ | ||
239 | if (card->ext_csd.sectors > (2u * 1024 * 1024 * 1024) / 512) | ||
238 | mmc_card_set_blockaddr(card); | 240 | mmc_card_set_blockaddr(card); |
239 | } | 241 | } |
240 | 242 | ||