Patchwork [4/4] mtd: OneNAND: OMAP2: increase multiblock erase verify timeout

login
register
mail settings
Submitter Adrian Hunter
Date Feb. 7, 2011, 8:47 a.m.
Message ID <1297068421-14430-5-git-send-email-adrian.hunter@nokia.com>
Download mbox | patch
Permalink /patch/82084/
State Accepted
Commit c497dd5594ed3ef97bc563b07e8c050618f745a3
Headers show

Comments

Adrian Hunter - Feb. 7, 2011, 8:47 a.m.
From: Roman Tereshonkov <roman.tereshonkov@nokia.com>

The current multiblock erase verify read timeout 100us is the maximum
for none-error case. If errors happen during multibock erase then
the specification recommends to run multiblock erase verify command
with maximum timeout 10ms (see specs. for KFM4G16Q2A and KFN8G16Q2A).

For the most common non-error case we wait 100us in udelay polling
loop. In case of timeout the interrupt mode is used to wait for the
command end.

Signed-off-by: Roman Tereshonkov <roman.tereshonkov@nokia.com>
---
 drivers/mtd/onenand/omap2.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)
Tony Lindgren - Feb. 17, 2011, 11:46 p.m.
* Adrian Hunter <adrian.hunter@nokia.com> [110207 00:45]:
> From: Roman Tereshonkov <roman.tereshonkov@nokia.com>
> 
> The current multiblock erase verify read timeout 100us is the maximum
> for none-error case. If errors happen during multibock erase then
> the specification recommends to run multiblock erase verify command
> with maximum timeout 10ms (see specs. for KFM4G16Q2A and KFN8G16Q2A).
> 
> For the most common non-error case we wait 100us in udelay polling
> loop. In case of timeout the interrupt mode is used to wait for the
> command end.
> 
> Signed-off-by: Roman Tereshonkov <roman.tereshonkov@nokia.com>

I'll queue this series. Anybody from MTD list care to ack this patch?

Regards,

Tony

> ---
>  drivers/mtd/onenand/omap2.c |    8 +++-----
>  1 files changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/mtd/onenand/omap2.c b/drivers/mtd/onenand/omap2.c
> index 3e1bb95..ec26399 100644
> --- a/drivers/mtd/onenand/omap2.c
> +++ b/drivers/mtd/onenand/omap2.c
> @@ -148,11 +148,9 @@ static int omap2_onenand_wait(struct mtd_info *mtd, int state)
>  			wait_err("controller error", state, ctrl, intr);
>  			return -EIO;
>  		}
> -		if ((intr & intr_flags) != intr_flags) {
> -			wait_err("timeout", state, ctrl, intr);
> -			return -EIO;
> -		}
> -		return 0;
> +		if ((intr & intr_flags) == intr_flags)
> +			return 0;
> +		/* Continue in wait for interrupt branch */
>  	}
>  
>  	if (state != FL_READING) {
> -- 
> 1.7.0.4
>
Artem Bityutskiy - Feb. 18, 2011, 4:31 a.m.
Hi,

On Thu, 2011-02-17 at 15:46 -0800, Tony Lindgren wrote:
> * Adrian Hunter <adrian.hunter@nokia.com> [110207 00:45]:
> > From: Roman Tereshonkov <roman.tereshonkov@nokia.com>
> > 
> > The current multiblock erase verify read timeout 100us is the maximum
> > for none-error case. If errors happen during multibock erase then
> > the specification recommends to run multiblock erase verify command
> > with maximum timeout 10ms (see specs. for KFM4G16Q2A and KFN8G16Q2A).
> > 
> > For the most common non-error case we wait 100us in udelay polling
> > loop. In case of timeout the interrupt mode is used to wait for the
> > command end.
> > 
> > Signed-off-by: Roman Tereshonkov <roman.tereshonkov@nokia.com>
> 
> I'll queue this series. Anybody from MTD list care to ack this patch?

Acked-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Tony Lindgren - Feb. 18, 2011, 5:34 p.m.
* Artem Bityutskiy <dedekind1@gmail.com> [110217 20:31]:
> Hi,
> 
> On Thu, 2011-02-17 at 15:46 -0800, Tony Lindgren wrote:
> > * Adrian Hunter <adrian.hunter@nokia.com> [110207 00:45]:
> > > From: Roman Tereshonkov <roman.tereshonkov@nokia.com>
> > > 
> > > The current multiblock erase verify read timeout 100us is the maximum
> > > for none-error case. If errors happen during multibock erase then
> > > the specification recommends to run multiblock erase verify command
> > > with maximum timeout 10ms (see specs. for KFM4G16Q2A and KFN8G16Q2A).
> > > 
> > > For the most common non-error case we wait 100us in udelay polling
> > > loop. In case of timeout the interrupt mode is used to wait for the
> > > command end.
> > > 
> > > Signed-off-by: Roman Tereshonkov <roman.tereshonkov@nokia.com>
> > 
> > I'll queue this series. Anybody from MTD list care to ack this patch?
> 
> Acked-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>

Thanks!

Tony

Patch

diff --git a/drivers/mtd/onenand/omap2.c b/drivers/mtd/onenand/omap2.c
index 3e1bb95..ec26399 100644
--- a/drivers/mtd/onenand/omap2.c
+++ b/drivers/mtd/onenand/omap2.c
@@ -148,11 +148,9 @@  static int omap2_onenand_wait(struct mtd_info *mtd, int state)
 			wait_err("controller error", state, ctrl, intr);
 			return -EIO;
 		}
-		if ((intr & intr_flags) != intr_flags) {
-			wait_err("timeout", state, ctrl, intr);
-			return -EIO;
-		}
-		return 0;
+		if ((intr & intr_flags) == intr_flags)
+			return 0;
+		/* Continue in wait for interrupt branch */
 	}
 
 	if (state != FL_READING) {