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

Commit 4cf8c6dd authored by Adrian Hunter's avatar Adrian Hunter Committed by Chris Ball
Browse files

mmc: core: make erase timeout calculation allow for gated clock



The erase timeout calculation may depend on clock rate
which is zero if the clock is gated, so use
mmc_host_clk_rate() which allows for that case.

Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
Signed-off-by: default avatarChris Ball <cjb@laptop.org>
parent ddd6fa7e
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -1245,7 +1245,7 @@ static unsigned int mmc_mmc_erase_timeout(struct mmc_card *card,
		 */
		 */
		timeout_clks <<= 1;
		timeout_clks <<= 1;
		timeout_us += (timeout_clks * 1000) /
		timeout_us += (timeout_clks * 1000) /
			      (card->host->ios.clock / 1000);
			      (mmc_host_clk_rate(card->host) / 1000);


		erase_timeout = timeout_us / 1000;
		erase_timeout = timeout_us / 1000;