mmc: core: Use a default maximum erase timeout
commit12182affc74a8ce1e95bd4feeb1638c55d2ab6fd
authorUlf Hansson <ulf.hansson@linaro.org>
Tue, 26 Jul 2016 22:04:03 +0000 (27 00:04 +0200)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 26 Sep 2016 19:31:24 +0000 (26 21:31 +0200)
tree58944a3f9bd7be327ed6655292625356edbb1d98
parent4ae12588e028f66a505b2287e8237a1815ee31a3
mmc: core: Use a default maximum erase timeout

In cases when the host->max_busy_timeout isn't specified, the calculated
number of maximum discard sectors defaults to UINT_MAX. This may cause a
too long timeout for a discard request.

Avoid this by using a default maximum erase timeout of 60s, used when we
calculate the maximum number of sectors that are allowed to be discarded
per request.

Do note that the minimum number of sectors to be discarded is still at
least one "preferred erase size".

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com>
drivers/mmc/core/core.c