summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNing Feiyi <feiyix.ning@intel.com>2017-04-07 11:16:30 +0200
committerBertolin, PierreX <pierrex.bertolin@intel.com>2017-04-10 06:44:44 -0700
commit4ea50719e0b930ca811a1453da825e432f806ccd (patch)
treeaa9ae1c32e43161c614744ea929a1a982e7ad62e
parenta57190bda9bea7fd8d2e35fe3b7626344527b0a6 (diff)
downloadx86-4ea50719e0b930ca811a1453da825e432f806ccd.tar.gz
mmc: core: calculate the max_discard_to for all mmc card
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: I407c3c40515a8157871955157d8cb60b9f5fc9eb Tracked-On: https://jira01.devtools.intel.com/browse/AW-4870 Signed-off-by: Ning Feiyi <feiyix.ning@intel.com> Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.com> Signed-off-by: Simon Dubray <simonx.dubray@intel.com> Reviewed-on: https://android.intel.com/577310 Reviewed-by: Bel Aj Ali, HabibX <habibx.bel.aj.ali@intel.com> Reviewed-by: Nassiet, GaelleX <gaellex.nassiet@intel.com> Reviewed-by: Ledentec, AlexandreX <alexandrex.ledentec@intel.com> Reviewed-by: Tasayco Loarte, VictorX <victorx.tasayco.loarte@intel.com> Reviewed-by: Louis, FabienX <fabienx.louis@intel.com> Reviewed-by: Korpershoek, MattijsX <mattijsx.korpershoek@intel.com>
-rw-r--r--drivers/mmc/core/core.c8
1 files changed, 0 insertions, 8 deletions
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index e059ff616a01..75f893fbf6ce 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -2430,14 +2430,6 @@ unsigned int mmc_calc_max_discard(struct mmc_card *card)
if (!host->max_busy_timeout)
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);