Re: TMIO MMC: full patchset.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx>
> 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@xxxxxxxxxxxxxx>
> ---
>  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?
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux