From c9e2e4429da39fe2d3e622fba51ebf68e00e3caa Mon Sep 17 00:00:00 2001 From: Vijay Viswanath Date: Thu, 20 Jul 2017 15:50:19 +0530 Subject: [PATCH 1/2] mmc: sdhci-msm: Put platform suspend in late suspend list Since there is no longer a parent child relation between the platform sdhc device and the sdhc card, there is a possibility that the mmc card suspend can be executed after sdhc platform suspend is done. This can happen if async suspend of mmc card is enabled. Suspending of mmc card requires platform device to be on and platform device suspend should occur after mmc card suspend. To ensure this ordering in system suspend case, let the card suspend in the regular suspend phase and make the platform device suspend in the late suspend phase of system suspend. Change-Id: I092056bf4099c09fcb4bd12695367f9d02ae9776 Signed-off-by: Vijay Viswanath --- drivers/mmc/host/sdhci-msm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c index 907763ddf234..984dcf992169 100644 --- a/drivers/mmc/host/sdhci-msm.c +++ b/drivers/mmc/host/sdhci-msm.c @@ -5009,7 +5009,7 @@ static int sdhci_msm_suspend_noirq(struct device *dev) } static const struct dev_pm_ops sdhci_msm_pmops = { - SET_SYSTEM_SLEEP_PM_OPS(sdhci_msm_suspend, sdhci_msm_resume) + SET_LATE_SYSTEM_SLEEP_PM_OPS(sdhci_msm_suspend, sdhci_msm_resume) SET_RUNTIME_PM_OPS(sdhci_msm_runtime_suspend, sdhci_msm_runtime_resume, NULL) .suspend_noirq = sdhci_msm_suspend_noirq, From 551803c610b9f1f9c5d67e6f60451aeff7960553 Mon Sep 17 00:00:00 2001 From: Vijay Viswanath Date: Thu, 29 Jun 2017 12:08:01 +0530 Subject: [PATCH 2/2] mmc: core: enable async suspend of card Enable the async suspend of the mmc card device. Suspending of card requires sending various commands and disabling some features especially in case of eMMC cards. This can take time. So enabling suspending of card asynchronously will allow other devices to suspend concurrently and make the system suspend faster. Change-Id: Id9987d2915cc02e48f74301febaf85a4d458478f Signed-off-by: Vijay Viswanath --- drivers/mmc/core/bus.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/mmc/core/bus.c b/drivers/mmc/core/bus.c index 311f6d639d06..548a9e8b72ae 100644 --- a/drivers/mmc/core/bus.c +++ b/drivers/mmc/core/bus.c @@ -401,6 +401,7 @@ int mmc_add_card(struct mmc_card *card) return ret; mmc_card_set_present(card); + device_enable_async_suspend(&card->dev); return 0; }