word line disturbance

Magnus Mårtensson magnus.martensson at axis.com
Tue Oct 14 11:31:26 EDT 2003


Hi.
I had a discussion with flash manufacturer Atmel last week regarding a phenomenon that we had seen. 
The phenomenon was called "word line disturbance" and it could occur if you tried to program only ones
to a location that already contained ones. The result could be that some bit on another address got tainted. Ex
writing 0xffff to address A could result in the content on address B changing from 0xffff to 0xfffe.

Anyway I thought of a software fix to this problem. Since it is unnecessary to write
ones to a place in flash where there already are only ones and since ones is the default bit state after an erase operation you
should simply skip that write. In our case this fix has also resulted in improvement in performance since we support firmware upgrades
over ftp and the firmware image is padded with 0xffff. The patch can be seen below (diff to 2.4.22 kernel).

Regards
/Magnus 

Index: cfi_cmdset_0002.c
===================================================================
RCS file: linux/drivers/mtd/chips/cfi_cmdset_0002.c,v
retrieving revision 1.1.1.4
diff -u -r1.1.1.4 cfi_cmdset_0002.c
--- cfi_cmdset_0002.c	17 Jun 2003 10:42:58 -0000	1.1.1.4
+++ cfi_cmdset_0002.c	14 Oct 2003 15:20:07 -0000
@@ -463,6 +463,12 @@
 	DECLARE_WAITQUEUE(wait, current);
 	int ret = 0;
 
+	/* Dont't write ones to a location that already contain ones. */	
+	if ((cfi_buswidth_is_1() && (datum == 0xff)) || 
+	    (cfi_buswidth_is_2() && (datum == 0xffff)) || 
+	    (cfi_buswidth_is_4() && (datum == 0xffffffff))) 
+		return ret;
+
  retry:
 	cfi_spin_lock(chip->mutex);
 
Index: amd_flash.c
===================================================================
RCS file: linux/drivers/mtd/chips/amd_flash.c,v
retrieving revision 1.1.1.5
diff -u -r1.1.1.5 amd_flash.c
--- amd_flash.c	17 Jun 2003 10:42:58 -0000	1.1.1.5
+++ amd_flash.c	14 Oct 2003 15:20:07 -0000
@@ -895,6 +895,12 @@
 	int ret = 0;
 	int times_left;
 
+	/* Dont't write ones to a location that already contain ones. */
+	if (((map->buswidth == 1) && (datum == 0xff)) ||
+	    ((map->buswidth == 2) && (datum == 0xffff)) ||
+	    ((map->buswidth == 4) && (datum == 0xffffffff))) 
+		return ret;
+
 retry:
 	spin_lock_bh(chip->mutex);




More information about the linux-mtd mailing list