public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
From: Ohad Ben-Cohen <ohad@wizery.com>
To: Daniel Drake <dsd@laptop.org>
Cc: linux-mmc@vger.kernel.org
Subject: Re: [PATCH] mmc: sdio: reset card during power_restore
Date: Thu, 9 Jun 2011 21:25:08 +0300	[thread overview]
Message-ID: <BANLkTinG-CmEh9yXL9Sp+W7PyatvEdOhZQ@mail.gmail.com> (raw)
In-Reply-To: <BANLkTi=VWUcCQJaBChnitVq1_TT1huE30A@mail.gmail.com>

On Thu, Jun 9, 2011 at 8:56 PM, Daniel Drake <dsd@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...

  reply	other threads:[~2011-06-09 18:25 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-05 12:38 [PATCH] mmc: sdio: reset card during power_restore Daniel Drake
2011-06-05 13:48 ` Ohad Ben-Cohen
2011-06-07 16:41   ` Daniel Drake
2011-06-07 20:52     ` Ohad Ben-Cohen
2011-06-08  9:20       ` Daniel Drake
2011-06-08  9:33         ` Ohad Ben-Cohen
2011-06-08 13:36           ` Daniel Drake
2011-06-08 14:02             ` Ohad Ben-Cohen
2011-06-08 14:21               ` Daniel Drake
2011-06-08 20:05                 ` Ohad Ben-Cohen
2011-06-08 20:58                   ` Daniel Drake
2011-06-09  3:23                     ` Ohad Ben-Cohen
2011-06-09 15:51                   ` Daniel Drake
2011-06-09 15:59                     ` Ohad Ben-Cohen
2011-06-09 16:21                       ` Daniel Drake
2011-06-09 16:30                         ` Ohad Ben-Cohen
2011-06-09 16:44                           ` Daniel Drake
2011-06-09 17:27                             ` Ohad Ben-Cohen
2011-06-09 17:56                               ` Daniel Drake
2011-06-09 18:25                                 ` Ohad Ben-Cohen [this message]
2011-06-09 19:55                                   ` Daniel Drake
2011-06-09 23:27                                     ` Ohad Ben-Cohen
2011-06-10 16:15                                       ` Daniel Drake
2011-06-13 19:52                                         ` Ohad Ben-Cohen
2011-06-16 17:27                                           ` Daniel Drake
2011-06-16 19:03                                             ` Philip Rakity
2011-06-16 21:22                                             ` Ohad Ben-Cohen
2011-06-17 13:58                                               ` Daniel Drake
2011-06-17 14:31                                                 ` Ohad Ben-Cohen
2011-06-17 15:19                                                   ` Daniel Drake
2011-06-19 10:33                                                   ` Daniel Drake
2011-06-19 11:00                                                     ` Ohad Ben-Cohen
2011-06-25 18:23                                                       ` Daniel Drake
2011-06-27 20:26                                                         ` Ohad Ben-Cohen
2011-06-28  9:13                                                           ` zhangfei gao
2011-06-28 11:10                                                             ` Ohad Ben-Cohen
2011-06-29  8:43                                                               ` zhangfei gao
2011-06-29  8:57                                                                 ` Ohad Ben-Cohen
2011-06-29  9:19                                                                   ` zhangfei gao
2011-06-29 15:25                                                                     ` Ohad Ben-Cohen
2011-06-29  8:56                                                             ` Daniel Drake
2011-06-07 21:01     ` Ohad Ben-Cohen
  -- strict thread matches above, loose matches on Subject: below --
2011-06-25 18:20 Daniel Drake
2011-06-26 12:33 ` Ohad Ben-Cohen
2011-06-26 15:23 ` Chris Ball

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BANLkTinG-CmEh9yXL9Sp+W7PyatvEdOhZQ@mail.gmail.com \
    --to=ohad@wizery.com \
    --cc=dsd@laptop.org \
    --cc=linux-mmc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox