All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Ball <cjb@laptop.org>
To: Ohad Ben-Cohen <ohad@wizery.com>
Cc: linux-mmc@vger.kernel.org
Subject: Re: [PATCH 1/3] mmc: skip detection of nonremovable cards on rescan
Date: Fri, 17 Dec 2010 00:51:23 +0000	[thread overview]
Message-ID: <20101217005123.GD17239@void.printf.net> (raw)
In-Reply-To: <1290921690-6133-2-git-send-email-ohad@wizery.com>

Hi Ohad,

On Sun, Nov 28, 2010 at 07:21:28AM +0200, Ohad Ben-Cohen wrote:
> mmc_rescan checks whether registered cards are still present before
> skipping them, by calling the bus-specific ->detect() handler.
> 
> With buses that support runtime PM, the card may be powered off at
> this point, so they need to be powered on and fully reinitialized before
> ->detect() executes.
> 
> This whole process is redundant with nonremovable cards; in those cases,
> we can safely skip calling ->detect() and implicitly assume its success.
> 
> Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
> ---
>  drivers/mmc/core/core.c |    8 ++++++--
>  1 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
> index 6286898..e8332d7 100644
> --- a/drivers/mmc/core/core.c
> +++ b/drivers/mmc/core/core.c
> @@ -1506,8 +1506,12 @@ void mmc_rescan(struct work_struct *work)
>  
>  	mmc_bus_get(host);
>  
> -	/* if there is a card registered, check whether it is still present */
> -	if ((host->bus_ops != NULL) && host->bus_ops->detect && !host->bus_dead)
> +	/*
> +	 * if there is a _removable_ card registered, check whether it is
> +	 * still present
> +	 */
> +	if ((host->bus_ops != NULL) && host->bus_ops->detect && !host->bus_dead
> +					&& mmc_card_is_removable(host))
>  		host->bus_ops->detect(host);
>  
>  	mmc_bus_put(host);

Thanks, pushed to mmc-next with trivial cleanup as below:

diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index e7c0c78..d9c98ee 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -1506,8 +1506,12 @@ void mmc_rescan(struct work_struct *work)
 
 	mmc_bus_get(host);
 
-	/* if there is a card registered, check whether it is still present */
-	if ((host->bus_ops != NULL) && host->bus_ops->detect && !host->bus_dead)
+	/*
+	 * if there is a _removable_ card registered, check whether it is
+	 * still present
+	 */
+	if (host->bus_ops && host->bus_ops->detect && !host->bus_dead
+	    && mmc_card_is_removable(host))
 		host->bus_ops->detect(host);
 
 	mmc_bus_put(host);
-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

  reply	other threads:[~2010-12-17  0:51 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-28  5:21 [PATCH 0/3] SDIO suspend/resume optimizations Ohad Ben-Cohen
2010-11-28  5:21 ` [PATCH 1/3] mmc: skip detection of nonremovable cards on rescan Ohad Ben-Cohen
2010-12-17  0:51   ` Chris Ball [this message]
2010-12-19 22:11     ` Ohad Ben-Cohen
2011-03-04  2:22       ` [PATCH 1/3] mmc: skip detection of nonremovable cards on rescan - card removal detection regression Maxim Levitsky
2011-03-04  2:28         ` Chris Ball
2011-03-04  2:52           ` Maxim Levitsky
2011-03-04  5:25             ` Jaehoon Chung
2011-03-04 15:40               ` Maxim Levitsky
2011-03-05 15:03         ` Ohad Ben-Cohen
2011-03-07 19:01           ` Dmitry Shmidt
2011-03-08 16:44             ` Ohad Ben-Cohen
2011-03-08 17:02               ` Maxim Levitsky
2011-03-08 21:10                 ` Ohad Ben-Cohen
2010-11-28  5:21 ` [PATCH 2/3] mmc: sdio: don't reinitialize nonremovable powered-resumed cards Ohad Ben-Cohen
2010-11-28  8:42   ` Michał Mirosław
2010-11-28  8:46     ` Ohad Ben-Cohen
2010-11-28  8:58       ` Ohad Ben-Cohen
2010-12-17  0:53   ` Chris Ball
2010-11-28  5:21 ` [PATCH 3/3] mmc: sdio: don't power up cards on system suspend Ohad Ben-Cohen
2010-12-17  1:00   ` 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=20101217005123.GD17239@void.printf.net \
    --to=cjb@laptop.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=ohad@wizery.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.