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>
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);