From: lintao Date: Mon, 22 Sep 2014 07:09:28 +0000 (+0800) Subject: mmc: fix low-end gpio-debounce detection failed dpm suspend X-Git-Tag: firefly_0821_release~4642 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=67decff741763da862b7436a4fe84517c7edc660;p=firefly-linux-kernel-4.4.55.git mmc: fix low-end gpio-debounce detection failed dpm suspend --- diff --git a/drivers/mmc/host/rk_sdmmc.c b/drivers/mmc/host/rk_sdmmc.c index 59d3299b9b6a..310b591080ea 100755 --- a/drivers/mmc/host/rk_sdmmc.c +++ b/drivers/mmc/host/rk_sdmmc.c @@ -4091,8 +4091,17 @@ int dw_mci_suspend(struct dw_mci *host) /*only for sdmmc controller*/ if (host->mmc->restrict_caps & RESTRICT_CARD_TYPE_SD) { host->mmc->rescan_disable = 1; - if (cancel_delayed_work_sync(&host->mmc->detect)) - wake_unlock(&host->mmc->detect_wake_lock); + if (!(cpu_is_rk312x() || cpu_is_rk3036())) { + if (cancel_delayed_work_sync(&host->mmc->detect)) + wake_unlock(&host->mmc->detect_wake_lock); + } else { + /* we find dpm suspend timeout for mmc cancel this work sync way, + actually just workaround this for low end platform with + gpio-debounce detect method. + */ + if (cancel_delayed_work(&host->mmc->detect)) + wake_unlock(&host->mmc->detect_wake_lock); + } disable_irq(host->irq); if (pinctrl_select_state(host->pinctrl, host->pins_idle) < 0)