Revert "mmc: subtract boot sectors from disk size for eMMC 4.3+ devices"
authorColin Cross <ccross@android.com>
Sat, 12 Feb 2011 21:21:32 +0000 (13:21 -0800)
committerColin Cross <ccross@android.com>
Tue, 14 Jun 2011 16:09:53 +0000 (09:09 -0700)
This reverts commit f0b0e4bec1e89014f3dcef4da8bcf95428cc771c.

The reverted commit incorrectly calculates the size of eMMC
devices in some (all?) cases.

This revert may cause problems in cases where the bootloader was
bug-compatible and puts a GPT partition at the incorrect end of
the eMMC device.

Signed-off-by: Colin Cross <ccross@android.com>
drivers/mmc/core/mmc.c
include/linux/mmc/mmc.h

index 868f511b3f2e209ae85713df0b6ae0429f6ce137..2a7e43bc796dfd1e798ad60a1ae6d0e7b98278a2 100644 (file)
@@ -274,13 +274,8 @@ static int mmc_read_ext_csd(struct mmc_card *card, u8 *ext_csd)
                        ext_csd[EXT_CSD_SEC_CNT + 3] << 24;
 
                /* Cards with density > 2GiB are sector addressed */
-               if (card->ext_csd.sectors > (2u * 1024 * 1024 * 1024) / 512) {
-                       unsigned boot_sectors;
-                       /* size is in 256K chunks, i.e. 512 sectors each */
-                       boot_sectors = ext_csd[EXT_CSD_BOOT_SIZE_MULTI] * 512;
-                       card->ext_csd.sectors -= boot_sectors;
+               if (card->ext_csd.sectors > (2u * 1024 * 1024 * 1024) / 512)
                        mmc_card_set_blockaddr(card);
-               }
        }
 
        switch (ext_csd[EXT_CSD_CARD_TYPE] & EXT_CSD_CARD_TYPE_MASK) {
index 630ea24af1d8300d8258efe9f020248238c57744..ac26a685cca8a82e55f2b6eba31ee1321ff70727 100644 (file)
@@ -283,7 +283,6 @@ struct _mmc_csd {
 #define EXT_CSD_SEC_ERASE_MULT         230     /* RO */
 #define EXT_CSD_SEC_FEATURE_SUPPORT    231     /* RO */
 #define EXT_CSD_TRIM_MULT              232     /* RO */
-#define EXT_CSD_BOOT_SIZE_MULTI                226     /* RO */
 
 /*
  * EXT_CSD field definitions