]>
Commit | Line | Data |
---|---|---|
6cbd67ed GKH |
1 | From c4c8eeb4df00aabb641553d6fbcd46f458e56cd9 Mon Sep 17 00:00:00 2001 |
2 | From: Vaibhav Bedia <vaibhav.bedia@ti.com> | |
3 | Date: Thu, 13 Sep 2012 06:31:03 +0000 | |
4 | Subject: mmc: omap_hsmmc: Pass on the suspend failure to the PM core | |
5 | ||
6 | From: Vaibhav Bedia <vaibhav.bedia@ti.com> | |
7 | ||
8 | commit c4c8eeb4df00aabb641553d6fbcd46f458e56cd9 upstream. | |
9 | ||
10 | In some cases mmc_suspend_host() is not able to claim the | |
11 | host and proceed with the suspend process. The core returns | |
12 | -EBUSY to the host controller driver. Unfortunately, the | |
13 | host controller driver does not pass on this information | |
14 | to 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 | ||
22 | The return status from mmc_suspend_host() is overwritten by return | |
23 | status from host->pdata->resume. So the original return status is lost. | |
24 | ||
25 | In these cases the MMC core gets to an unexpected state | |
26 | during resume and multiple issues related to MMC crop up. | |
27 | 1. Host controller driver starts accessing the device registers | |
28 | before the clocks are enabled which leads to a prefetch abort. | |
29 | 2. A file copy thread which was launched before suspend gets | |
30 | stuck due to the host not being reclaimed during resume. | |
31 | ||
32 | To avoid such problems pass on the -EBUSY status to the PM core | |
33 | from the host controller driver. With this change, MMC core | |
34 | suspend might still fail but it does not end up making the | |
35 | system unusable. Suspend gets aborted and the user can try | |
36 | suspending the system again. | |
37 | ||
38 | Signed-off-by: Vaibhav Bedia <vaibhav.bedia@ti.com> | |
39 | Signed-off-by: Hebbar, Gururaja <gururaja.hebbar@ti.com> | |
40 | Acked-by: Venkatraman S <svenkatr@ti.com> | |
41 | Signed-off-by: Chris Ball <cjb@laptop.org> | |
42 | Signed-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; |