Skip to content

Commit

Permalink
mmc: core: make erase timeout calculation allow for gated clock
Browse files Browse the repository at this point in the history
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: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
  • Loading branch information
Adrian Hunter authored and Chris Ball committed Jun 25, 2011
1 parent ddd6fa7 commit 4cf8c6d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/mmc/core/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1245,7 +1245,7 @@ static unsigned int mmc_mmc_erase_timeout(struct mmc_card *card,
*/
timeout_clks <<= 1;
timeout_us += (timeout_clks * 1000) /
(card->host->ios.clock / 1000);
(mmc_host_clk_rate(card->host) / 1000);

erase_timeout = timeout_us / 1000;

Expand Down

0 comments on commit 4cf8c6d

Please sign in to comment.