On Thu, Jun 9, 2011 at 8:56 PM, Daniel Drake <d...@laptop.org> wrote:
> Done, the rmmod issue remains fixed - the card gets powered down during rmmod.

great !

> Next up is the problem where on this setup, if I suspend after loading
> the module, and the module asks the card to shut down during suspend,
> it fails to get brought up during resume.

we need to take into account that driver core change I spotted.

> Note that I have now rolled in a patch you made in another thread to
> correctly call into the driver's remove routine during suspend when
> powering down the card.

let's update that patch. I'd send you an updated one, but I have to go
for awhile, so here's the quick change you need to do.

replace the put_noidle() call in the hunk below with a put_sync():

diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
index 4d0c15b..e23888a 100644
--- a/drivers/mmc/core/sdio.c
+++ b/drivers/mmc/core/sdio.c
@@ -540,6 +540,13 @@ static void mmc_sdio_remove(struct mmc_host *host)
        BUG_ON(!host);
        BUG_ON(!host->card);

+       /*
+        * if this card is managed by runtime pm, make sure it is powered on
+        * before invoking its SDIO functions' ->remove() handler
+        */
+       if (host->caps & MMC_CAP_POWER_OFF_CARD)
+               pm_runtime_get_sync(&host->card->dev);
+
        for (i = 0;i < host->card->sdio_funcs;i++) {
                if (host->card->sdio_func[i]) {
                        sdio_remove_func(host->card->sdio_func[i]);
@@ -547,6 +554,9 @@ static void mmc_sdio_remove(struct mmc_host *host)
                }
        }

+       if (host->caps & MMC_CAP_POWER_OFF_CARD)
+               pm_runtime_put_noidle(&host->card->dev);   //<==============  
use
pm_runtime_put_sync here
+
        mmc_remove_card(host->card);
        host->card = NULL;
 }

tell me how it goes...
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to