mtd/include/linux/mtd map.h,1.45,1.46

David Woodhouse dwmw2 at infradead.org
Wed Jan 5 12:09:47 EST 2005


Update of /home/cvs/mtd/include/linux/mtd
In directory phoenix.infradead.org:/tmp/cvs-serv1165

Modified Files:
	map.h 
Log Message:
[PATCH] Bug in 2.6.10 mtd driver for physmem mapped flash chips

The patch below fixes a small but fatal bug in the code that handles
non-buswidth-aligned writes. The problem is that the code used the same
index in both map_word and buf, therefore putting the wrong words in the
map_word that partially contains old data and partially contains new
data. The result: corrupt data is being written.

Signed-off-by: Koen Martens <kmartens at sonologic.nl>


Index: map.h
===================================================================
RCS file: /home/cvs/mtd/include/linux/mtd/map.h,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -r1.45 -r1.46
--- map.h	21 Sep 2004 14:31:17 -0000	1.45
+++ map.h	5 Jan 2005 17:09:44 -0000	1.46
@@ -322,7 +322,7 @@
 			bitpos = (map_bankwidth(map)-1-i)*8;
 #endif
 			orig.x[0] &= ~(0xff << bitpos);
-			orig.x[0] |= buf[i] << bitpos;
+			orig.x[0] |= buf[i-start] << bitpos;
 		}
 	}
 	return orig;





More information about the linux-mtd-cvs mailing list