summaryrefslogtreecommitdiff
path: root/drivers/mmc
diff options
context:
space:
mode:
authorNitin Ghate <nghate@nvidia.com>2010-07-20 18:55:59 +0530
committerGary King <gking@nvidia.com>2010-07-20 09:43:38 -0700
commitbb1a7adb7e06600782f0aab4eb5c53848871c3ba (patch)
tree295a0882b9d90474a88f90adce5f8794d1c91a1b /drivers/mmc
parent05b8a0683f0ae76328f2d03c13c15b1b98059aba (diff)
MMC: fix to report correct disk space in case of emmc 4.3+ cards
change to subtract the boot partiotion size from the entire device size so that proper device size is reported. updated the code as per suggestions from Gary, removed the comment bug: 683019 Change-Id: Iaa1a8d773dc1b876eb1da55823ff44a7f745d234 Reviewed-on: http://git-master/r/3496 Tested-by: Nitin Ghate <nghate@nvidia.com> Reviewed-by: Gary King <gking@nvidia.com>
Diffstat (limited to 'drivers/mmc')
-rwxr-xr-xdrivers/mmc/core/mmc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index 3a37ecab4a37..e4c905f15c6d 100755
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -166,6 +166,7 @@ static int mmc_read_ext_csd(struct mmc_card *card)
{
int err;
u8 *ext_csd;
+ unsigned offs;
BUG_ON(!card);
@@ -229,12 +230,14 @@ static int mmc_read_ext_csd(struct mmc_card *card)
ext_csd[EXT_CSD_SEC_CNT + 3] << 24;
if (card->ext_csd.sectors) {
#ifdef CONFIG_EMBEDDED_MMC_START_OFFSET
- unsigned offs;
offs = card->host->ops->get_host_offset(card->host);
offs >>= 9;
BUG_ON(offs >= card->ext_csd.sectors);
card->ext_csd.sectors -= offs;
#endif
+ offs = ext_csd[EXT_CSD_BOOT_SIZE_MULTI] * SZ_256K / 512;
+ card->ext_csd.sectors -= offs;
+
}
}