On Thu, Nov 11, 2010 at 05:05:19PM +0800, Chuanxiao.Dong wrote: > From 04704a1c769dc4d15b5fb54d65d8ad46f6c5f57a Mon Sep 17 00:00:00 2001 > From: Chuanxiao Dong <chuanxiao.dong@xxxxxxxxx> > Date: Thu, 11 Nov 2010 13:42:32 +0800 > Subject: [PATCH 1/3] mmc: add erase timeout calculation routine for sdhci host > > Erase command needs R1b response which means after HD handle > a CMD_RESPONSE interrupt, driver also need to wait for a while. > For SDHCI host controller, HD also need to handle a DATA_END > interrupt. > During device handle erase cmd, if the blocks need to be erased > are too many, some SDHCI host controller maybe launch a TIMEOUT > interrupt before the erase cmd finishing. To avoid this kind of > situation, SDHCI HD need to calculate a correct timeout value > before issuing erase cmd. Patch added a routine to implement > this. Just a formal thing I noticed on a glimpse... > diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c > index 154cbf8..79fcca2 100644 > --- a/drivers/mmc/host/sdhci.c > +++ b/drivers/mmc/host/sdhci.c > @@ -879,6 +879,48 @@ static void sdhci_finish_data(struct sdhci_host *host) > tasklet_schedule(&host->finish_tasklet); > } > > +static void sdhci_set_erasetimeout(struct sdhci_host *host, > + unsigned int erase_timeout) > +{ > + u64 current_timeout; > + int count = 0xe; I'd suggest a define with a speaking name instead of all the hardcoded 0xe. -- Pengutronix e.K. | Wolfram Sang | Industrial Linux Solutions | http://www.pengutronix.de/ |
Attachment:
signature.asc
Description: Digital signature