Merge "mmc: host: set correct state when suspend fails"

This commit is contained in:
Linux Build Service Account 2016-05-02 03:07:31 -07:00 committed by Gerrit - the friendly Code Review server
commit bae1c87257

View file

@ -193,14 +193,16 @@ static int mmc_host_suspend(struct device *dev)
__func__, ret);
/* reset CQE state if host suspend fails */
if (ret < 0 && host->card && host->card->cmdq_init) {
int err = 0;
mmc_card_clr_suspended(host->card);
mmc_host_clk_hold(host);
host->cmdq_ops->enable(host);
mmc_host_clk_release(host);
ret = mmc_cmdq_halt(host, false);
if (ret) {
err = mmc_cmdq_halt(host, false);
if (err) {
mmc_release_host(host);
pr_err("%s: halt: failed: %d\n", __func__, ret);
pr_err("%s: halt: failed: %d\n",
__func__, err);
goto out;
}
}
@ -220,10 +222,13 @@ static int mmc_host_suspend(struct device *dev)
spin_unlock_irqrestore(&host->clk_lock, flags);
mmc_set_ios(host);
}
spin_lock_irqsave(&host->clk_lock, flags);
host->dev_status = DEV_SUSPENDED;
spin_unlock_irqrestore(&host->clk_lock, flags);
out:
spin_lock_irqsave(&host->clk_lock, flags);
if (ret)
host->dev_status = DEV_RESUMED;
else
host->dev_status = DEV_SUSPENDED;
spin_unlock_irqrestore(&host->clk_lock, flags);
return ret;
}