@@ -1761,6 +1761,13 @@ void sdhci_set_power_noreg(struct sdhci_host *host, unsigned char mode,
sdhci_writeb(host, 0, SDHCI_POWER_CONTROL);
if (host->quirks2 & SDHCI_QUIRK2_CARD_ON_NEEDS_BUS_ON)
sdhci_runtime_pm_bus_off(host);
+
+ /*
+ * Some controllers need an extra 100ms delay to secure
+ * full power cycle is successful.
+ */
+ if (host->quirks2 & SDHCI_QUIRK2_DELAY_AFTER_POWER_OFF)
+ msleep(100);
} else {
/*
* Spec says that we should clear the power reg before setting
@@ -482,6 +482,8 @@ struct sdhci_host {
* block count.
*/
#define SDHCI_QUIRK2_USE_32BIT_BLK_CNT (1<<18)
+/* Controllers need an extra 100ms delay to make sure power off completely */
+#define SDHCI_QUIRK2_DELAY_AFTER_POWER_OFF (1<<19)
int irq; /* Device IRQ */
void __iomem *ioaddr; /* Mapped address */
Add delay after power off to ensure that full power cycle is successful. Otherwise, some controllers, at lease for Hisilicon eMMC controller, may not be unstable sometimes for full power cycle operation. Signed-off-by: Jun Nie <jun.nie@linaro.org> --- drivers/mmc/host/sdhci.c | 7 +++++++ drivers/mmc/host/sdhci.h | 2 ++ 2 files changed, 9 insertions(+) -- 2.17.1