diff mbox

-ENOSYS suspend-powerdown regression

Message ID BANLkTi=fwnNVwtxOo66k7M-4Jxu=3eD2xQ@mail.gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ohad Ben Cohen June 28, 2011, 10:04 p.m. UTC
On Wed, Jun 29, 2011 at 12:54 AM, Daniel Drake <dsd@laptop.org> wrote:
> Too many patches floating around, just trying to be sure of what I'm doing!

Ok, let's start from fresh :)

Let's take 3.0-rc5, it already includes our work:

297c7f2 mmc: sdio: fix runtime PM path during driver removal
c6e633a mmc: sdio: reset card during power_restore

Then apply these hunks:

 		host->flags |= SDHCI_AUTO_CMD12;


I think this should be enough (I don't remember anything else pending).

Thanks,
Ohad.
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Daniel Drake July 6, 2011, 3:53 p.m. UTC | #1
On 28 June 2011 23:04, Ohad Ben-Cohen <ohad@wizery.com> wrote:
> On Wed, Jun 29, 2011 at 12:54 AM, Daniel Drake <dsd@laptop.org> wrote:
>> Too many patches floating around, just trying to be sure of what I'm doing!
>
> Ok, let's start from fresh :)
>
> Let's take 3.0-rc5, it already includes our work:
>
> 297c7f2 mmc: sdio: fix runtime PM path during driver removal
> c6e633a mmc: sdio: reset card during power_restore
>
> Then apply these hunks:

Thanks, done. Sorry for the delay in getting to this.

Unfortunately something is still weird, this is possibly a case that
we missed before.

Even if I just do the simplistic test of booting, and then suspending
(without loading the libertas driver), things go wrong:
http://dev.laptop.org/~dsd/20110706/dmesg.txt

I added printk's in mmc_power_save_host and mmc_power_restore_host.
The strange thing is that it tries to resume mmc1 even though it is
powered down and there is no available driver, and also that it then
tries to power it down again (but it is already off).

Daniel
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Daniel Drake July 8, 2011, 3:38 p.m. UTC | #2
On 6 July 2011 16:53, Daniel Drake <dsd@laptop.org> wrote:
> Thanks, done. Sorry for the delay in getting to this.
>
> Unfortunately something is still weird, this is possibly a case that
> we missed before.
>
> Even if I just do the simplistic test of booting, and then suspending
> (without loading the libertas driver), things go wrong:
> http://dev.laptop.org/~dsd/20110706/dmesg.txt
>
> I added printk's in mmc_power_save_host and mmc_power_restore_host.
> The strange thing is that it tries to resume mmc1 even though it is
> powered down and there is no available driver, and also that it then
> tries to power it down again (but it is already off).

I tested vanilla and realised that this bug exists there too - it is
not related to your patch. So lets ignore it for now so that we can
get unblocked on the runtime PM work.

Your latest patch works fine. Card got powered down during suspend,
and powered on,off,on during resume (as expected) and probed fine and
continued working :)

So I'd say we're good to go on this one and move onto the other pending stuff.

Thanks!
Daniel
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Ohad Ben Cohen July 18, 2011, 1:53 a.m. UTC | #3
On Fri, Jul 8, 2011 at 6:38 PM, Daniel Drake <dsd@laptop.org> wrote:
> I tested vanilla and realised that this bug exists there too

I'm aware of it - it's caused (indirectly) by another PM core change,
which since then was already changed again in 3.1.

Btw sorry for not being responsive - I've been mostly offline lately
due to family getting bigger ;)

Thanks for pushing the patches forward.
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/mmc/core/sdio_bus.c b/drivers/mmc/core/sdio_bus.c
index d29b9c3..73dc3c2 100644
--- a/drivers/mmc/core/sdio_bus.c
+++ b/drivers/mmc/core/sdio_bus.c
@@ -167,11 +167,8 @@  static int sdio_bus_remove(struct device *dev)
       int ret = 0;

       /* Make sure card is powered before invoking ->remove() */
-       if (func->card->host->caps & MMC_CAP_POWER_OFF_CARD) {
-               ret = pm_runtime_get_sync(dev);
-               if (ret < 0)
-                       goto out;
-       }
+       if (func->card->host->caps & MMC_CAP_POWER_OFF_CARD)
+               pm_runtime_get_sync(dev);

       drv->remove(func);

@@ -191,7 +188,6 @@  static int sdio_bus_remove(struct device *dev)
       if (func->card->host->caps & MMC_CAP_POWER_OFF_CARD)
               pm_runtime_put_noidle(dev);

-out:
       return ret;
 }

diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 58d5436..ce3e2e2 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -2488,7 +2488,7 @@  int sdhci_add_host(struct sdhci_host *host)
 	} else
 		mmc->f_min = host->max_clk / SDHCI_MAX_DIV_SPEC_200;

-	mmc->caps |= MMC_CAP_SDIO_IRQ | MMC_CAP_ERASE | MMC_CAP_CMD23;
+	mmc->caps |= MMC_CAP_SDIO_IRQ | MMC_CAP_ERASE | MMC_CAP_CMD23 |
MMC_CAP_POWER_OFF_CARD;

 	if (host->quirks & SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12)