[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1277194762-21399-1-git-send-email-rabin.vincent@stericsson.com>
Date: Tue, 22 Jun 2010 13:49:22 +0530
From: Rabin Vincent <rabin.vincent@...ricsson.com>
To: <linux-mmc@...r.kernel.org>
Cc: <linux-kernel@...r.kernel.org>,
<STEricsson_nomadik_linux@...t.st.com>,
Hanumath Prasad <hanumath.prasad@...ricsson.com>,
Rabin Vincent <rabin.vincent@...ricsson.com>,
Linus Walleij <linus.walleij@...ricsson.com>
Subject: [PATCH] mmc: only set blockaddressed for > 2GiB cards
From: Hanumath Prasad <hanumath.prasad@...ricsson.com>
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@...ricsson.com>
Signed-off-by: Hanumath Prasad <hanumath.prasad@...ricsson.com>
Signed-off-by: Rabin Vincent <rabin.vincent@...ricsson.com>
---
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 89f7a25..1dc784e 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -222,7 +222,9 @@ static int mmc_read_ext_csd(struct mmc_card *card)
ext_csd[EXT_CSD_SEC_CNT + 1] << 8 |
ext_csd[EXT_CSD_SEC_CNT + 2] << 16 |
ext_csd[EXT_CSD_SEC_CNT + 3] << 24;
- if (card->ext_csd.sectors)
+
+ /* Cards with density > 2GiB are sector addressed */
+ if (card->ext_csd.sectors > (2u * 1024 * 1024 * 1024) / 512)
mmc_card_set_blockaddr(card);
}
--
1.7.0
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists