@@ -2304,7 +2304,6 @@ void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
{
struct sdhci_host *host = mmc_priv(mmc);
bool reinit_uhs = host->reinit_uhs;
- bool turning_on_clk = false;
u8 ctrl;
host->reinit_uhs = false;
@@ -2334,8 +2333,6 @@ void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
sdhci_enable_preset_value(host, false);
if (!ios->clock || ios->clock != host->clock) {
- turning_on_clk = ios->clock && !host->clock;
-
host->ops->set_clock(host, ios->clock);
host->clock = ios->clock;
@@ -2363,11 +2360,10 @@ void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
host->ops->set_bus_width(host, ios->bus_width);
/*
- * Special case to avoid multiple clock changes during voltage
- * switching.
+ * Avoid unnecessary changes. In particular, this avoids multiple clock
+ * changes during voltage switching.
*/
if (!reinit_uhs &&
- turning_on_clk &&
host->timing == ios->timing &&
host->version >= SDHCI_SPEC_300 &&
(host->preset_enabled || host->drv_type == ios->drv_type) &&
Avoid re-configuring UHS and preset settings when the settings have not changed, irrespective of whether the clock is turning on. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> --- drivers/mmc/host/sdhci.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)