Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 221dfda3 authored by Ziqi Chen's avatar Ziqi Chen Committed by Ram Prakash Gupta
Browse files

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: I4f92ecc8afe6614019da5f5e51c37ceca85af819
Signed-off-by: default avatarZiqi Chen <ziqichen@codeaurora.org>
Signed-off-by: default avatarSayali Lokhande <sayalil@codeaurora.org>
parent 3d8e2a98
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -3266,6 +3266,10 @@ 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 ||
			(host->caps2 & MMC_CAP2_MAX_DISCARD_SIZE))
		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