Skip to contentSkip to conversation

mmc: sdhci: implement light and heavy runtime pm resume

RFC New Jisheng Zhang 1 participant 1 message Feb 5, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

RFC 1/1 mmc: sdhci: implement light and heavy runtime pm resume

Hi all,

Most sdhci_runtime_resume_host() users just gate their clocks in their runtime suspend implementation, so the sdhci_runtime_resume_host() is too heavy, we only need to restore interrupts registers.

The change is something as following:

drivers/mmc/host/sdhci.c +10 -1
index 0ad412a..9d5bdde 100644
@@ -2856,7 +2856,7 @@ int sdhci_runtime_suspend_host(struct sdhci_host *host)
 }
 EXPORT_SYMBOL_GPL(sdhci_runtime_suspend_host);
 
-int sdhci_runtime_resume_host(struct sdhci_host *host)
+static void sdhci_runtime_resume_reinit(struct sdhci_host *host)
 {
 	unsigned long flags;
 	int host_flags = host->flags;
@@ -2880,6 +2880,15 @@ int sdhci_runtime_resume_host(struct sdhci_host *host)
 		sdhci_enable_preset_value(host, true);
 		spin_unlock_irqrestore(&host->lock, flags);
 	}
+}
+
+int sdhci_runtime_resume_host(struct sdhci_host *host, bool power_keeped)
+{
+	unsigned long flags;
+	int host_flags = host->flags;
+
+	if (!power_keeped)
+		sdhci_runtime_resume_reinit(host);
 
 	/* Set the re-tuning expiration flag */
 	if (host->flags & SDHCI_USING_RETUNING_TIMER)

It's ugly, but per my test on marvell BG2Q platforms, this change can improve the resume latency from 5500us to 11us. Is there any better solution?

Thanks in advance,
Jisheng