public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [patch] cfi: remove warning message on expected behaivor
@ 2005-10-04 20:49 Jan Pedersen
  2005-10-05 13:28 ` Jörn Engel
  2005-10-05 14:25 ` David Vrabel
  0 siblings, 2 replies; 3+ messages in thread
From: Jan Pedersen @ 2005-10-04 20:49 UTC (permalink / raw)
  To: linux-mtd

When an erase operation is in progress, the DQ5 (data bit 5 / exceeded
timing limit) pin on the flash chips may raise just before operation
complete is detected. This is expected behaivor because when the erase is
complete, DQ5 switches from 'exceeded timing limit' to 'data bit 5' which
therefore might be read as '1' just before operation complete is detected.
This fix is well tested.

Signed-off-by: Jan Pedersen <jp@jp-embedded.com>
---
diff -Naur linux-2.4.31.org/drivers/mtd/chips/cfi_cmdset_0002.c
linux-2.4.31/drivers/mtd/chips/cfi_cmdset_0002.c
--- linux-2.4.31.org/drivers/mtd/chips/cfi_cmdset_0002.c	2004-11-17
06:54:21.000000000 -0500
+++ linux-2.4.31/drivers/mtd/chips/cfi_cmdset_0002.c	2005-08-22
12:14:17.000000000 -0400
@@ -950,12 +950,8 @@
 		    oldstatus   = cfi_read( map, adr );
 		    status      = cfi_read( map, adr );
 		    
-		    if( ( oldstatus & 0x00FF ) == ( status & 0x00FF ) )
+		    if( ( oldstatus & 0x00FF ) != ( status & 0x00FF ) )
 		    {
-                printk( "Warning: DQ5 raised while erase operation was in
progress, but erase completed OK\n" ); 		    
-		    } 			
-			else
-            {
 			    /* DQ5 is active so we can do a reset and stop
the erase */
 				cfi_write(map, CMD(0xF0), chip->start);
                 printk( KERN_WARNING "Internal flash device timeout occured
or write operation was performed while flash was erasing\n" );

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch] cfi: remove warning message on expected behaivor
  2005-10-04 20:49 [patch] cfi: remove warning message on expected behaivor Jan Pedersen
@ 2005-10-05 13:28 ` Jörn Engel
  2005-10-05 14:25 ` David Vrabel
  1 sibling, 0 replies; 3+ messages in thread
From: Jörn Engel @ 2005-10-05 13:28 UTC (permalink / raw)
  To: Jan Pedersen; +Cc: linux-mtd

On Tue, 4 October 2005 22:49:21 +0200, Jan Pedersen wrote:
> 
> When an erase operation is in progress, the DQ5 (data bit 5 / exceeded
> timing limit) pin on the flash chips may raise just before operation
> complete is detected. This is expected behaivor because when the erase is
> complete, DQ5 switches from 'exceeded timing limit' to 'data bit 5' which
> therefore might be read as '1' just before operation complete is detected.
> This fix is well tested.

Do you have a testcase that fails with old code and succeeds with new
code?

> Signed-off-by: Jan Pedersen <jp@jp-embedded.com>
> ---
> diff -Naur linux-2.4.31.org/drivers/mtd/chips/cfi_cmdset_0002.c
> linux-2.4.31/drivers/mtd/chips/cfi_cmdset_0002.c
> --- linux-2.4.31.org/drivers/mtd/chips/cfi_cmdset_0002.c	2004-11-17
> 06:54:21.000000000 -0500
> +++ linux-2.4.31/drivers/mtd/chips/cfi_cmdset_0002.c	2005-08-22
> 12:14:17.000000000 -0400
> @@ -950,12 +950,8 @@
>  		    oldstatus   = cfi_read( map, adr );
>  		    status      = cfi_read( map, adr );
>  		    
> -		    if( ( oldstatus & 0x00FF ) == ( status & 0x00FF ) )
> +		    if( ( oldstatus & 0x00FF ) != ( status & 0x00FF ) )
>  		    {
> -                printk( "Warning: DQ5 raised while erase operation was in
> progress, but erase completed OK\n" ); 		    
> -		    } 			
> -			else
> -            {
>  			    /* DQ5 is active so we can do a reset and stop
> the erase */
>  				cfi_write(map, CMD(0xF0), chip->start);
>                  printk( KERN_WARNING "Internal flash device timeout occured
> or write operation was performed while flash was erasing\n" );

Jörn

-- 
The grand essentials of happiness are: something to do, something to
love, and something to hope for.
-- Allan K. Chalmers

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch] cfi: remove warning message on expected behaivor
  2005-10-04 20:49 [patch] cfi: remove warning message on expected behaivor Jan Pedersen
  2005-10-05 13:28 ` Jörn Engel
@ 2005-10-05 14:25 ` David Vrabel
  1 sibling, 0 replies; 3+ messages in thread
From: David Vrabel @ 2005-10-05 14:25 UTC (permalink / raw)
  To: Jan Pedersen; +Cc: linux-mtd

Jan Pedersen wrote:
> When an erase operation is in progress, the DQ5 (data bit 5 / exceeded
> timing limit) pin on the flash chips may raise just before operation
> complete is detected. This is expected behaivor because when the erase is
> complete, DQ5 switches from 'exceeded timing limit' to 'data bit 5' which
> therefore might be read as '1' just before operation complete is detected.
> This fix is well tested.

If you look at the current cfi_cmdset_0002.c (in 2.6) you'll notice that
all it does it check for toggling bits.  The software timeout handles
failed erases and writes rather than checking DQ5.

Trying to handle the various error bits was deemed too tricky/complex to
get right for interleaved chips.

David Vrabel
-- 
David Vrabel, Design Engineer

Arcom, Clifton Road           Tel: +44 (0)1223 411200 ext. 3233
Cambridge CB1 7EA, UK         Web: http://www.arcom.com/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-10-05 14:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-04 20:49 [patch] cfi: remove warning message on expected behaivor Jan Pedersen
2005-10-05 13:28 ` Jörn Engel
2005-10-05 14:25 ` David Vrabel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox