linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mmc: omap_hsmmc: Pass on the suspend failure to the PM core
@ 2012-09-04 13:08 Hebbar, Gururaja
  2012-09-11  5:43 ` S, Venkatraman
  0 siblings, 1 reply; 4+ messages in thread
From: Hebbar, Gururaja @ 2012-09-04 13:08 UTC (permalink / raw)
  To: linux-omap, linux-mmc, svenkatr
  Cc: rob.herring, linux-kernel, grant.likely, cjb, nsekhar,
	sudhakar.raj, gururaja.hebbar, Vaibhav Bedia

From: Vaibhav Bedia <vaibhav.bedia@ti.com>

In some cases mmc_suspend_host() is not able to claim the
host and proceed with the suspend process. The core returns
-EBUSY to the host controller driver. Unfortunately, the
host controller driver does not pass on this information
to the PM core and hence the system suspend process continues.

In these cases the MMC core gets to an unexpected state
during resume and multiple issues related to MMC crop up.
1. Host controller driver starts accessing the device registers
before the clocks are enabled which leads to a prefetch abort.
2. A file copy thread which was launched before suspend gets
stuck due to the host not being reclaimed during resume.

To avoid such problems pass on the -EBUSY status to the PM core
from the host controller driver. With this change, MMC core
suspend might still fail but it does not end up making the
system unusable. Suspend gets aborted and the user can try
suspending the system again.

Signed-off-by: Vaibhav Bedia <vaibhav.bedia@ti.com>
Signed-off-by: Hebbar, Gururaja <gururaja.hebbar@ti.com>
---
:100644 100644 9afdd20... c3e96a2... M	drivers/mmc/host/omap_hsmmc.c
 drivers/mmc/host/omap_hsmmc.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 9afdd20..c3e96a2 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -2054,6 +2054,7 @@ static int omap_hsmmc_suspend(struct device *dev)
 			if (ret)
 				dev_dbg(dev, "Unmask interrupt failed\n");
 		}
+		ret = -EBUSY;
 		goto err;
 	}
 
-- 
1.7.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mmc: omap_hsmmc: Pass on the suspend failure to the PM core
  2012-09-04 13:08 [PATCH] mmc: omap_hsmmc: Pass on the suspend failure to the PM core Hebbar, Gururaja
@ 2012-09-11  5:43 ` S, Venkatraman
  2012-09-12  7:48   ` Hebbar, Gururaja
  2012-09-13  7:09   ` Hebbar, Gururaja
  0 siblings, 2 replies; 4+ messages in thread
From: S, Venkatraman @ 2012-09-11  5:43 UTC (permalink / raw)
  To: Hebbar, Gururaja
  Cc: linux-omap, linux-mmc, rob.herring, linux-kernel, grant.likely,
	cjb, nsekhar, sudhakar.raj, Vaibhav Bedia

On Tue, Sep 4, 2012 at 6:38 PM, Hebbar, Gururaja <gururaja.hebbar@ti.com> wrote:
> From: Vaibhav Bedia <vaibhav.bedia@ti.com>
>
> In some cases mmc_suspend_host() is not able to claim the
> host and proceed with the suspend process. The core returns
> -EBUSY to the host controller driver. Unfortunately, the
> host controller driver does not pass on this information
> to the PM core and hence the system suspend process continues.
>
> In these cases the MMC core gets to an unexpected state
> during resume and multiple issues related to MMC crop up.
> 1. Host controller driver starts accessing the device registers
> before the clocks are enabled which leads to a prefetch abort.
> 2. A file copy thread which was launched before suspend gets
> stuck due to the host not being reclaimed during resume.
>
> To avoid such problems pass on the -EBUSY status to the PM core
> from the host controller driver. With this change, MMC core
> suspend might still fail but it does not end up making the
> system unusable. Suspend gets aborted and the user can try
> suspending the system again.
>

The last time we discussed this, didn't we plan to fix this differently ?
Holding the return code of mmc_suspend_host in a separate variable and
passing it to the caller
of omap_hsmmc_suspend looks more sane to me.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH] mmc: omap_hsmmc: Pass on the suspend failure to the PM core
  2012-09-11  5:43 ` S, Venkatraman
@ 2012-09-12  7:48   ` Hebbar, Gururaja
  2012-09-13  7:09   ` Hebbar, Gururaja
  1 sibling, 0 replies; 4+ messages in thread
From: Hebbar, Gururaja @ 2012-09-12  7:48 UTC (permalink / raw)
  To: S, Venkatraman
  Cc: linux-omap, linux-mmc, rob.herring, linux-kernel, grant.likely,
	cjb, Nori, Sekhar, Rajashekhara, Sudhakar, Bedia, Vaibhav

On Tue, Sep 11, 2012 at 11:13:26, S, Venkatraman wrote:
> On Tue, Sep 4, 2012 at 6:38 PM, Hebbar, Gururaja <gururaja.hebbar@ti.com> wrote:
> > From: Vaibhav Bedia <vaibhav.bedia@ti.com>
> >
> > In some cases mmc_suspend_host() is not able to claim the
> > host and proceed with the suspend process. The core returns
> > -EBUSY to the host controller driver. Unfortunately, the
> > host controller driver does not pass on this information
> > to the PM core and hence the system suspend process continues.
> >
> > In these cases the MMC core gets to an unexpected state
> > during resume and multiple issues related to MMC crop up.
> > 1. Host controller driver starts accessing the device registers
> > before the clocks are enabled which leads to a prefetch abort.
> > 2. A file copy thread which was launched before suspend gets
> > stuck due to the host not being reclaimed during resume.
> >
> > To avoid such problems pass on the -EBUSY status to the PM core
> > from the host controller driver. With this change, MMC core
> > suspend might still fail but it does not end up making the
> > system unusable. Suspend gets aborted and the user can try
> > suspending the system again.
> >
> 
> The last time we discussed this, didn't we plan to fix this differently ?
> Holding the return code of mmc_suspend_host in a separate variable and
> passing it to the caller
> of omap_hsmmc_suspend looks more sane to me.

Correct. I missed it. I will reformat the patch and resend it.

> 


Regards, 
Gururaja

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH] mmc: omap_hsmmc: Pass on the suspend failure to the PM core
  2012-09-11  5:43 ` S, Venkatraman
  2012-09-12  7:48   ` Hebbar, Gururaja
@ 2012-09-13  7:09   ` Hebbar, Gururaja
  1 sibling, 0 replies; 4+ messages in thread
From: Hebbar, Gururaja @ 2012-09-13  7:09 UTC (permalink / raw)
  To: S, Venkatraman
  Cc: linux-omap, linux-mmc, rob.herring, linux-kernel, grant.likely,
	cjb, Nori, Sekhar, Rajashekhara, Sudhakar, Bedia, Vaibhav

On Tue, Sep 11, 2012 at 11:13:26, S, Venkatraman wrote:
> On Tue, Sep 4, 2012 at 6:38 PM, Hebbar, Gururaja <gururaja.hebbar@ti.com> wrote:
> > From: Vaibhav Bedia <vaibhav.bedia@ti.com>
> >
> > In some cases mmc_suspend_host() is not able to claim the
> > host and proceed with the suspend process. The core returns
> > -EBUSY to the host controller driver. Unfortunately, the
> > host controller driver does not pass on this information
> > to the PM core and hence the system suspend process continues.
> >
> > In these cases the MMC core gets to an unexpected state
> > during resume and multiple issues related to MMC crop up.
> > 1. Host controller driver starts accessing the device registers
> > before the clocks are enabled which leads to a prefetch abort.
> > 2. A file copy thread which was launched before suspend gets
> > stuck due to the host not being reclaimed during resume.
> >
> > To avoid such problems pass on the -EBUSY status to the PM core
> > from the host controller driver. With this change, MMC core
> > suspend might still fail but it does not end up making the
> > system unusable. Suspend gets aborted and the user can try
> > suspending the system again.
> >
> 
> The last time we discussed this, didn't we plan to fix this differently ?
> Holding the return code of mmc_suspend_host in a separate variable and
> passing it to the caller
> of omap_hsmmc_suspend looks more sane to me.

I just pushed a new revision (V2) with above changes. I also added extra information 
(explanation with code snippet). Kindly let me know your review for the same.

> 

Regards, 
Gururaja

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-09-13  7:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-04 13:08 [PATCH] mmc: omap_hsmmc: Pass on the suspend failure to the PM core Hebbar, Gururaja
2012-09-11  5:43 ` S, Venkatraman
2012-09-12  7:48   ` Hebbar, Gururaja
2012-09-13  7:09   ` Hebbar, Gururaja

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).