mmc: revert runtime idle state

Remove the runtime idle state. It was introduced by
217cf95511d23f703d0e7e597d3132739739654b
Instead of checking BKOPS logic in the runtime idle state, all relevant
logic should be performed in runtime suspend callback.

CRs-Fixed: 979630
Change-Id: Iaf0d8326c0e3fd6507b075339f2cc87ae1bdf6b2
Signed-off-by: Konstantin Dorfman <kdorfman@codeaurora.org>
[subhashj@codeaurora.org: fixed trivial merge conflicts]
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
This commit is contained in:
Konstantin Dorfman 2015-12-31 13:25:40 +02:00 committed by Subhash Jadavani
parent 47bbd75b7b
commit f4c7f1c573
4 changed files with 3 additions and 98 deletions

View file

@ -4207,13 +4207,6 @@ static int mmc_blk_probe(struct mmc_card *card)
pm_runtime_use_autosuspend(&card->dev);
pm_runtime_set_autosuspend_delay(&card->dev, MMC_AUTOSUSPEND_DELAY_MS);
/*
* If there is a runtime_idle function, it should take care of
* suspending the card
*/
if (card->host->bus_ops->runtime_idle)
pm_runtime_dont_use_autosuspend(&card->dev);
else
pm_runtime_use_autosuspend(&card->dev);
/*

View file

@ -201,21 +201,10 @@ static int mmc_runtime_resume(struct device *dev)
return host->bus_ops->runtime_resume(host);
}
static int mmc_runtime_idle(struct device *dev)
{
struct mmc_card *card = mmc_dev_to_card(dev);
struct mmc_host *host = card->host;
if (host->bus_ops->runtime_idle)
return host->bus_ops->runtime_idle(host);
return 0;
}
#endif /* !CONFIG_PM */
static const struct dev_pm_ops mmc_bus_pm_ops = {
SET_RUNTIME_PM_OPS(mmc_runtime_suspend, mmc_runtime_resume,
mmc_runtime_idle)
SET_RUNTIME_PM_OPS(mmc_runtime_suspend, mmc_runtime_resume, NULL)
SET_SYSTEM_SLEEP_PM_OPS(mmc_bus_suspend, mmc_bus_resume)
};

View file

@ -2113,19 +2113,6 @@ void mmc_get_card(struct mmc_card *card)
}
EXPORT_SYMBOL(mmc_get_card);
/*
* This is a helper function, which drops the runtime
* pm reference for the card device.
*/
void __mmc_put_card(struct mmc_card *card)
{
/* In case of runtime_idle, it will handle the suspend */
if (card->host->bus_ops->runtime_idle)
pm_runtime_put(&card->dev);
else
pm_runtime_put_autosuspend(&card->dev);
}
EXPORT_SYMBOL(__mmc_put_card);
/*
* This is a helper function, which releases the host and drops the runtime
@ -2135,7 +2122,7 @@ void mmc_put_card(struct mmc_card *card)
{
mmc_release_host(card->host);
pm_runtime_mark_last_busy(&card->dev);
__mmc_put_card(card);
pm_runtime_put_autosuspend(&card->dev);
}
EXPORT_SYMBOL(mmc_put_card);

View file

@ -2786,69 +2786,6 @@ static int mmc_reset(struct mmc_host *host)
return mmc_init_card(host, card->ocr, card);
}
#define NO_AUTOSUSPEND (-1)
static int mmc_runtime_idle(struct mmc_host *host)
{
int err = 0;
bool halt_cmdq;
BUG_ON(!host->card);
mmc_claim_host(host);
halt_cmdq = mmc_card_cmdq(host->card) &&
(host->card->bkops.needs_check ||
host->card->bkops.needs_manual);
/*
* If there are active requests, can't check for bkops. Postpone
* until the next time that runtime_idle is scheduled.
*/
if (host->cmdq_ctx.active_reqs)
goto no_suspend;
if (halt_cmdq) {
err = mmc_cmdq_halt(host, true);
if (err) {
pr_err("%s: %s failed to halt cmdq (%d)\n",
mmc_hostname(host), __func__, err);
goto out;
}
}
if (host->card->bkops.needs_manual)
host->card->bkops.needs_check = false;
if (host->card->bkops.needs_check) {
mmc_check_bkops(host->card);
host->card->bkops.needs_check = false;
}
if (host->card->bkops.needs_manual)
mmc_start_manual_bkops(host->card);
if (halt_cmdq) {
err = mmc_cmdq_halt(host, false);
if (err)
pr_err("%s: %s failed to unhalt cmdq (%d)\n",
mmc_hostname(host), __func__, err);
}
out:
/*
* TODO: consider prolonging suspend when bkops
* is running in order to allow a longer time for
* bkops to complete
* */
pm_schedule_suspend(&host->card->dev, MMC_AUTOSUSPEND_DELAY_MS);
no_suspend:
mmc_release_host(host);
pm_runtime_mark_last_busy(&host->card->dev);
/* return negative value in order to avoid autosuspend */
return (err) ? err : NO_AUTOSUSPEND;
}
static const struct mmc_bus_ops mmc_ops = {
.remove = mmc_remove,
.detect = mmc_detect,
@ -2856,7 +2793,6 @@ static const struct mmc_bus_ops mmc_ops = {
.resume = mmc_resume,
.runtime_suspend = mmc_runtime_suspend,
.runtime_resume = mmc_runtime_resume,
.runtime_idle = mmc_runtime_idle,
.alive = mmc_alive,
.change_bus_speed = mmc_change_bus_speed,
.reset = mmc_reset,