mmc: core: allow hosts to specify a large discard size

max_busy_timeout is used to decide whether R1B response should be used or a
R1 response should be used. This is also used to decide what the discard
size of mmc queue (registered with block layer) can be set to. In order to
keep both the features in place, this change will allow for hosts to
specify a larger discard size while still specifying max_busy_timeout.

Change-Id: I1e607329c4377897a7cb4086db02cbc150bd02b7
Signed-off-by: Krishna Konda <kkonda@codeaurora.org>
This commit is contained in:
Krishna Konda 2015-09-26 17:38:26 -07:00 committed by Subhash Jadavani
parent 09f5d9f021
commit 6d9a04f1b1
2 changed files with 4 additions and 1 deletions

View file

@ -3761,7 +3761,8 @@ unsigned int mmc_calc_max_discard(struct mmc_card *card)
struct mmc_host *host = card->host;
unsigned int max_discard, max_trim;
if (!host->max_busy_timeout)
if (!host->max_busy_timeout ||
(host->caps2 & MMC_CAP2_MAX_DISCARD_SIZE))
return UINT_MAX;
/*

View file

@ -442,6 +442,8 @@ struct mmc_host {
#define MMC_CAP2_CMD_QUEUE (1 << 26) /* support eMMC command queue */
#define MMC_CAP2_SANITIZE (1 << 27) /* Support Sanitize */
#define MMC_CAP2_SLEEP_AWAKE (1 << 28) /* Use Sleep/Awake (CMD5) */
/* use max discard ignoring max_busy_timeout parameter */
#define MMC_CAP2_MAX_DISCARD_SIZE (1 << 29)
mmc_pm_flag_t pm_caps; /* supported pm features */