mirror of
https://github.com/team-infusion-developers/android_kernel_samsung_msm8976.git
synced 2024-09-21 11:53:01 +00:00
Merge "mmc: host: set correct state when suspend fails"
This commit is contained in:
commit
bae1c87257
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue