提交 4760257c 编写于 作者: A Adrian Hunter 提交者: Ulf Hansson

mmc: sdio: Keep card runtime resumed while adding function devices

Drivers core will runtime suspend a device with no driver. That means the
SDIO card will be runtime suspended as soon as it is added. It is then
runtime resumed to add each function. That is entirely pointless, so add
pm runtime get/put to keep the SDIO card runtime resumed until the function
devices have been added.
Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
上级 82e7edc2
......@@ -1103,6 +1103,12 @@ int mmc_attach_sdio(struct mmc_host *host)
* Enable runtime PM only if supported by host+card+board
*/
if (host->caps & MMC_CAP_POWER_OFF_CARD) {
/*
* Do not allow runtime suspend until after SDIO function
* devices are added.
*/
pm_runtime_get_noresume(&card->dev);
/*
* Let runtime PM core know our card is active
*/
......@@ -1155,6 +1161,9 @@ int mmc_attach_sdio(struct mmc_host *host)
goto remove_added;
}
if (host->caps & MMC_CAP_POWER_OFF_CARD)
pm_runtime_put(&card->dev);
mmc_claim_host(host);
return 0;
......@@ -1164,7 +1173,9 @@ int mmc_attach_sdio(struct mmc_host *host)
remove_added:
/*
* The devices are being deleted so it is not necessary to disable
* runtime PM.
* runtime PM. Similarly we also don't pm_runtime_put() the SDIO card
* because it needs to be active to remove any function devices that
* were probed, and after that it gets deleted.
*/
mmc_sdio_remove(host);
mmc_claim_host(host);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册