public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
From: Matt Fleming <matt@console-pimps.org>
To: Ian Molton <ian@mnementh.co.uk>
Cc: linux-mmc@vger.kernel.org, magnus.damm@gmail.com,
	sameo@openedhand.com, pb@handhelds.org, philipp.zabel@gmail.com,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Pierre Ossman <pierre@ossman.eu>
Subject: Re: TMIO MMC: full patchset.
Date: Tue, 29 Sep 2009 14:20:58 +0100	[thread overview]
Message-ID: <20090929132058.GC6934@console-pimps.org> (raw)
In-Reply-To: <c09aa50a0909290552j1c371ddfpc7444d5d87e66f76@mail.gmail.com>

On Tue, Sep 29, 2009 at 01:52:50PM +0100, Ian Molton wrote:
> From bc0e0adbc24cb7bf8c0119e65d43b42410ce316a Mon Sep 17 00:00:00 2001
> From: Ian Molton <ian@mnementh.co.uk>
> Date: Tue, 29 Sep 2009 13:39:29 +0100
> Subject: [PATCH 5/5] MMC: Retry initialisation at a lower frequency if it times out
> 
> 	This patch retrys the MMC card initialisation at a lower frequency
> 	if it fails. It is needed on certain tmio controllers with fussy cards.
> 
> Signed-off-by: Ian Molton <ian@mnementh.co.uk>
> ---
>  drivers/mmc/core/mmc.c |   11 ++++++++++-
>  1 files changed, 10 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
> index 06084db..03e782f 100644
> --- a/drivers/mmc/core/mmc.c
> +++ b/drivers/mmc/core/mmc.c
> @@ -295,13 +295,17 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
>  	struct mmc_card *oldcard)
>  {
>  	struct mmc_card *card;
> -	int err;
> +	int err, slow_retry = 0;
>  	u32 cid[4];
>  	unsigned int max_dtr;
>  
>  	BUG_ON(!host);
>  	WARN_ON(!host->claimed);
>  
> +retry:
> +	if (slow_retry)
> +		mmc_set_clock(host, host->f_min);
> +
>  	/*
>  	 * Since we're changing the OCR value, we seem to
>  	 * need to tell some cards to go back to the idle
> @@ -464,6 +468,11 @@ free_card:
>  		mmc_remove_card(card);
>  err:
>  
> +	if (err == -ETIMEDOUT && host->f_min < 400000) {
> +		slow_retry = 1;
> +		goto retry;
> +	}
> +
>  	return err;
>  }
>  
> -- 
> 1.6.3.3
> 

I'm not sure that propagating this magical 400kHz constant around the
MMC code is the best way to go. It could do with a #define.

You're the second person to run into issues with the lower limit
initialisation patch. Does anybody know where that value came from? Is
it definitely the best value to use or has it just been picked out of
the air?

  reply	other threads:[~2009-09-29 13:20 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-29 12:52 TMIO MMC: full patchset Ian Molton
2009-09-29 13:20 ` Matt Fleming [this message]
2009-09-29 18:32   ` Pierre Ossman
2009-09-30 11:41 ` Magnus Damm
2009-09-30 20:15   ` Ian Molton
2009-10-01  1:30     ` Magnus Damm
2009-10-01  1:39       ` Andrew Morton
2009-10-01 10:21         ` Ian Molton
2009-10-02  6:17         ` Magnus Damm
2009-10-02  7:23           ` Ian Molton
2009-10-02  7:55             ` pHilipp Zabel
2009-10-01 10:19       ` Ian Molton
2009-10-02  5:46         ` Magnus Damm
2009-10-02  7:31           ` Ian Molton
2009-10-02  7:57             ` Magnus Damm
2009-10-02 18:14               ` Ian Molton
2009-10-03 13:11                 ` Magnus Damm
2009-10-04  0:00                   ` Ian Molton
2009-10-04  5:05                     ` Magnus Damm
     [not found]                       ` <c09aa50a0910040851g51640678r5d1f79a50b01164a@mail.gmail.com>
2009-10-04 16:12                         ` Phil Blundell
2009-10-04 17:19                           ` Ian Molton
2009-10-05  6:49                         ` Magnus Damm
2009-09-30 16:59 ` Philipp Zabel
2009-09-30 21:49   ` Ian Molton

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=20090929132058.GC6934@console-pimps.org \
    --to=matt@console-pimps.org \
    --cc=ian@mnementh.co.uk \
    --cc=linux-mmc@vger.kernel.org \
    --cc=magnus.damm@gmail.com \
    --cc=pb@handhelds.org \
    --cc=philipp.zabel@gmail.com \
    --cc=pierre@ossman.eu \
    --cc=s.hauer@pengutronix.de \
    --cc=sameo@openedhand.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