Re: [PATCH] Powerpc/esdhc: Calculate the applicable timeout value for mmc erase

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

 



On Tue, Oct 30, 2012 at 02:00:55PM +0800, Haijun.Zhang wrote:
> As large area erase needs long time usually a few minutes,
> which the host can't wait will bring about timeout error.
> So we need to split the large area to small sections which
> only need short erase time to avoid timeout error.
> 
> Signed-off-by: Haijun Zhang <Haijun.Zhang@xxxxxxxxxxxxx>
> Signed-off-by: Jerry Huang <Chang-Ming.Huang@xxxxxxxxxxxxx>
> CC: Anton Vorontsov <cbouatmailru@xxxxxxxxx>
> ---
[...]
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -2560,6 +2560,16 @@ int sdhci_add_host(struct sdhci_host *host)
>  	} else
>  		mmc->f_min = host->max_clk / SDHCI_MAX_DIV_SPEC_200;
>  
> +	/*
> +	 * Calculate the max discard timeout  to limit the size one

Unneeded whitespace.

> +	 * discard request can issue.Just subtract the minimum timeout

Missing whitespace after the dot.

> +	 * value to avoid the circumstance the timeout value just equal to 0xF.
> +	 */
> +	if (host->timeout_clk &&
> +		!(host->quirks & SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK))

Wrong indentation on the second line (should be at least one more tab).

> +		mmc->max_discard_to = ((1 << 27) - (1 << 13) * 1000) /
> +			host->timeout_clk;

Is this some kind of generic formula? If not, it's better to place the
calculation into esdhc driver itself... Plus, where 27 and 13 came from?..

Otherwise, it looks good.

Thanks,
Anton.
--
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