linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ulf Hansson <ulf.hansson@stericsson.com>
To: "r66093@freescale.com" <r66093@freescale.com>
Cc: "linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>,
	Jerry Huang <Chang-Ming.Huang@freescale.com>
Subject: Re: [PATCH 3/4] MMC/core: Make sure the power is up, when detect the card
Date: Mon, 5 Dec 2011 16:48:03 +0100	[thread overview]
Message-ID: <4EDCE7B3.8090406@stericsson.com> (raw)
In-Reply-To: <1323077026-12071-3-git-send-email-r66093@freescale.com>

Hi Jerry,

r66093@freescale.com wrote:
> From: Jerry Huang <Chang-Ming.Huang@freescale.com>
> 
> Before running get_cd() recall function to detect whether the card is
> present, must make sure the power is up.
> 
> Signed-off-by: Jerry Huang <Chang-Ming.Huang@freescale.com>
> ---
>  drivers/mmc/core/core.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
> index 5278ffb..a08e6b1 100644
> --- a/drivers/mmc/core/core.c
> +++ b/drivers/mmc/core/core.c
> @@ -2066,8 +2066,10 @@ void mmc_rescan(struct work_struct *work)
>  	 */
>  	mmc_bus_put(host);
>  
> +	mmc_power_up(host);
>  	if (host->ops->get_cd && host->ops->get_cd(host) == 0)
>  		goto out;
> +	mmc_power_off(host);

This does not feel right. get_cd is typically a function which makes use 
of some GPIO pin to find out if there is a card present and thus no 
power_up should be needed.

If your host driver does not support GPIO mechanism of detecting the 
card, the polling mechanism is maybe what you want.

>  
>  	mmc_claim_host(host);
>  	for (i = 0; i < ARRAY_SIZE(freqs); i++) {


Best regards
Ulf Hansson

  parent reply	other threads:[~2011-12-05 15:48 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-05  9:23 [PATCH 1/4] SDHCI: add sdhci_get_cd callback to detect the card r66093
2011-12-05  9:23 ` [PATCH 2/4] MMC/SD: Add callback function to detect card r66093
2011-12-05  9:23   ` [PATCH 3/4] MMC/core: Make sure the power is up, when detect the card r66093
2011-12-05  9:23     ` [PATCH 4/4] MMC/core: Add f_min to mmc_power_on() r66093
2011-12-05 15:48     ` Ulf Hansson [this message]
2011-12-06  5:40       ` [PATCH 3/4] MMC/core: Make sure the power is up, when detect the card Huang Changming-R66093
2011-12-07  9:04     ` Linus Walleij
2011-12-09  3:16       ` Huang Changming-R66093
2011-12-09 10:03   ` [PATCH 2/4] MMC/SD: Add callback function to detect card Adrian Hunter
2011-12-13  7:25     ` Huang Changming-R66093
2011-12-13  8:01       ` Adrian Hunter
2011-12-13  8:26         ` Huang Changming-R66093
2011-12-13  8:54           ` Adrian Hunter
2011-12-13  9:55             ` Huang Changming-R66093
2011-12-13 10:26               ` Adrian Hunter
2011-12-14  2:21                 ` Huang Changming-R66093
2011-12-05 11:25 ` [PATCH 1/4] SDHCI: add sdhci_get_cd callback to detect the card Dong, Chuanxiao
2011-12-06  5:43   ` Huang Changming-R66093
2011-12-05 18:48 ` Philip Rakity
2011-12-06  5:35   ` Huang Changming-R66093
2011-12-13 18:06   ` Chris Ball
2011-12-14  2:31     ` Huang Changming-R66093

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=4EDCE7B3.8090406@stericsson.com \
    --to=ulf.hansson@stericsson.com \
    --cc=Chang-Ming.Huang@freescale.com \
    --cc=linux-mmc@vger.kernel.org \
    --cc=r66093@freescale.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 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).