mmc: core: calculate the max_discard_to for all mmc card
authorChuanxiao Dong <chuanxiao.dong@intel.com>
Thu, 20 Oct 2011 09:36:53 +0000 (17:36 +0800)
committermgross <mark.gross@intel.com>
Wed, 9 Nov 2011 21:15:56 +0000 (13:15 -0800)
To support erase/trim feature, MFLD host need a suitable
max_discard_sectors. Currently, if not enable ERASE_GROUP_DEF,
then driver will choose pref_erase which is not suitable for
MFLD host.

MFLD host still need driver to calculate a correct max_discard_sectors
but not directly use pref_erase. This patch will help to do so

Change-Id: I29a82bfcefa948e7e698a2170e30a2639bf954c3
Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.com>
drivers/mmc/core/core.c

index eba1965..fb9e3e4 100644 (file)
@@ -1737,14 +1737,6 @@ unsigned int mmc_calc_max_discard(struct mmc_card *card)
        if (!host->max_discard_to)
                return UINT_MAX;
 
-       /*
-        * Without erase_group_def set, MMC erase timeout depends on clock
-        * frequence which can change.  In that case, the best choice is
-        * just the preferred erase size.
-        */
-       if (mmc_card_mmc(card) && !(card->ext_csd.erase_group_def & 1))
-               return card->pref_erase;
-
        max_discard = mmc_do_calc_max_discard(card, MMC_ERASE_ARG);
        if (mmc_can_trim(card)) {
                max_trim = mmc_do_calc_max_discard(card, MMC_TRIM_ARG);