sdhci: correct clk_gate runtime_pm init
authorPierre Tardy <pierre.tardy@intel.com>
Thu, 25 Aug 2011 11:13:29 +0000 (12:13 +0100)
committermgross <mark.gross@intel.com>
Wed, 9 Nov 2011 20:38:44 +0000 (12:38 -0800)
at init, the default state of mmc_clkgate fw is clock not gate
So at boot, set_ios is not ensured to be called with ios->clock!=0
This may result to fabric errors at boot.

Correct this by setting the default host->iosclock to !=0
and taking a runtime_pm ref counter at init.

Change-Id: I32e8f31861b268d17047ca15eea45044b635a4bc
Signed-off-by: Pierre Tardy <pierre.tardy@intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
drivers/mmc/host/sdhci.c

index ef9bd6c..b717748 100644 (file)
@@ -2791,6 +2791,8 @@ int sdhci_add_host(struct sdhci_host *host)
        }
 
        sdhci_init(host, 0);
+       host->iosclock = 1; /* default clk_gate is 0 */
+       pm_runtime_get_noresume(host->mmc->parent);
 
 #ifdef CONFIG_MMC_DEBUG
        sdhci_dumpregs(host);