]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/3.6.2/mmc-omap_hsmmc-pass-on-the-suspend-failure-to-the-pm-core.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 3.6.2 / mmc-omap_hsmmc-pass-on-the-suspend-failure-to-the-pm-core.patch
CommitLineData
6cbd67ed
GKH
1From c4c8eeb4df00aabb641553d6fbcd46f458e56cd9 Mon Sep 17 00:00:00 2001
2From: Vaibhav Bedia <vaibhav.bedia@ti.com>
3Date: Thu, 13 Sep 2012 06:31:03 +0000
4Subject: mmc: omap_hsmmc: Pass on the suspend failure to the PM core
5
6From: Vaibhav Bedia <vaibhav.bedia@ti.com>
7
8commit c4c8eeb4df00aabb641553d6fbcd46f458e56cd9 upstream.
9
10In some cases mmc_suspend_host() is not able to claim the
11host and proceed with the suspend process. The core returns
12-EBUSY to the host controller driver. Unfortunately, the
13host controller driver does not pass on this information
14to the PM core and hence the system suspend process continues.
15
16 ret = mmc_suspend_host(host->mmc);
17 if (ret) {
18 host->suspended = 0;
19 if (host->pdata->resume) {
20 ret = host->pdata->resume(dev, host->slot_id);
21
22The return status from mmc_suspend_host() is overwritten by return
23status from host->pdata->resume. So the original return status is lost.
24
25In these cases the MMC core gets to an unexpected state
26during resume and multiple issues related to MMC crop up.
271. Host controller driver starts accessing the device registers
28before the clocks are enabled which leads to a prefetch abort.
292. A file copy thread which was launched before suspend gets
30stuck due to the host not being reclaimed during resume.
31
32To avoid such problems pass on the -EBUSY status to the PM core
33from the host controller driver. With this change, MMC core
34suspend might still fail but it does not end up making the
35system unusable. Suspend gets aborted and the user can try
36suspending the system again.
37
38Signed-off-by: Vaibhav Bedia <vaibhav.bedia@ti.com>
39Signed-off-by: Hebbar, Gururaja <gururaja.hebbar@ti.com>
40Acked-by: Venkatraman S <svenkatr@ti.com>
41Signed-off-by: Chris Ball <cjb@laptop.org>
42Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
43
44---
45 drivers/mmc/host/omap_hsmmc.c | 3 +--
46 1 file changed, 1 insertion(+), 2 deletions(-)
47
48--- a/drivers/mmc/host/omap_hsmmc.c
49+++ b/drivers/mmc/host/omap_hsmmc.c
50@@ -2106,8 +2106,7 @@ static int omap_hsmmc_suspend(struct dev
51 if (ret) {
52 host->suspended = 0;
53 if (host->pdata->resume) {
54- ret = host->pdata->resume(dev, host->slot_id);
55- if (ret)
56+ if (host->pdata->resume(dev, host->slot_id))
57 dev_dbg(dev, "Unmask interrupt failed\n");
58 }
59 goto err;