public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
From: Albert Herranz <albert_herranz@yahoo.es>
To: Philip Rakity <prakity@marvell.com>
Cc: Chris Ball <cjb@laptop.org>,
	"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>
Subject: Re: [BUG] CMD52 sent as first command not CMD0
Date: Sun, 06 Feb 2011 12:13:50 +0100	[thread overview]
Message-ID: <4D4E826E.40905@yahoo.es> (raw)
In-Reply-To: <173274DF-475D-44FB-8C34-25728D12ADBB@marvell.com>

Hi,

On 02/06/2011 02:35 AM, Philip Rakity wrote:
> 
> proposed solution:  I cannot verify this fix until Monday.
> =====
> 
> CMD52 is a reset for SDIO cards.  CMD0 is not sufficient when
> the card is being re-initialized.  Only send CMD52 if
> a) doing a reinitialize
> b) card is SDIO or SDIO_COMBO
> 
> Signed-off-by: Philip Rakity <prakity@marvell.com>
> ---
>  drivers/mmc/core/core.c |    7 ++++++-
>  1 files changed, 6 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
> index 30d4da4..f0ce6f6 100644
> --- a/drivers/mmc/core/core.c
> +++ b/drivers/mmc/core/core.c
> @@ -1521,7 +1521,12 @@ static int mmc_rescan_try_freq(struct mmc_host *host, unsigned freq)
>  		mmc_hostname(host), __func__, host->f_init);
>  #endif
>  	mmc_power_up(host);
> -	sdio_reset(host);
> +
> +	/* reset sdio before CMD0 when card is being reinitialized */
> +	if (host->card &&
> +		(host->card->type == MMC_TYPE_SDIO ||
> +		host->card->type == MMC_TYPE_SD_COMBO))
> +			sdio_reset(host);
>  	mmc_go_idle(host);
>  	mmc_hwungate_clock(host);
>  

At least on the Nintendo Wii, a platform reset _does not_ reset the SDIO hardware, and there is no known way to power-off/power-on it.
So, in some cases like after a system reboot, we need to issue a CMD52 before a CMD0 (even if on that particular case host->card is NULL) to properly reset the Nintendo Wii SDIO-based Wireless LAN card from its previous state, otherwise the card is not detected.

The proposed fix breaks this and makes the card unavailable after a system reboot.

If you are concerned about unconditionally issuing a CMD52 then we can use a quirk to make sure that we always perform a SDIO reset at least for the Nintendo Wii.

Cheers,
Albert

  parent reply	other threads:[~2011-02-06 11:19 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-04 22:53 [BUG] CMD52 sent as first command not CMD0 Philip Rakity
2011-02-04 23:19 ` Philip Rakity
2011-02-06  0:38 ` Chris Ball
2011-02-06  0:52   ` Philip Rakity
2011-02-06  1:11     ` Philip Rakity
2011-02-06  1:15     ` Chris Ball
2011-02-06  1:35       ` Philip Rakity
2011-02-06  1:50         ` Chris Ball
2011-02-06 16:02           ` David Vrabel
2011-02-06 11:13         ` Albert Herranz [this message]
2011-02-06 20:50           ` Philip Rakity
2011-02-07  0:55             ` Nicolas Pitre
2011-02-06 16:09     ` Tardy, Pierre

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=4D4E826E.40905@yahoo.es \
    --to=albert_herranz@yahoo.es \
    --cc=cjb@laptop.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=prakity@marvell.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