aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/s3c24xx/patches-2.6.24/1066-fix-hwecc-2410.patch.patch
diff options
context:
space:
mode:
authorMirko Vogt <mirko@openwrt.org>2008-12-12 11:58:53 +0000
committerMirko Vogt <mirko@openwrt.org>2008-12-12 11:58:53 +0000
commit614683faf8029100802db06a825648d0b6490285 (patch)
tree7401b135dc7ce24ff0175e67e0f2ce7f96296ff0 /target/linux/s3c24xx/patches-2.6.24/1066-fix-hwecc-2410.patch.patch
parent4a018d2445c5f249179ff82c8fffb0e3b717f738 (diff)
downloadupstream-614683faf8029100802db06a825648d0b6490285.tar.gz
upstream-614683faf8029100802db06a825648d0b6490285.tar.bz2
upstream-614683faf8029100802db06a825648d0b6490285.zip
changed Makefile and profiles, added patches for kernel 2.6.24 (stable-branch of Openmoko)
SVN-Revision: 13613
Diffstat (limited to 'target/linux/s3c24xx/patches-2.6.24/1066-fix-hwecc-2410.patch.patch')
-rw-r--r--target/linux/s3c24xx/patches-2.6.24/1066-fix-hwecc-2410.patch.patch66
1 files changed, 66 insertions, 0 deletions
diff --git a/target/linux/s3c24xx/patches-2.6.24/1066-fix-hwecc-2410.patch.patch b/target/linux/s3c24xx/patches-2.6.24/1066-fix-hwecc-2410.patch.patch
new file mode 100644
index 0000000000..d75b2ec93a
--- /dev/null
+++ b/target/linux/s3c24xx/patches-2.6.24/1066-fix-hwecc-2410.patch.patch
@@ -0,0 +1,66 @@
+From b6817bed9516a65276ee92437697cb46136df882 Mon Sep 17 00:00:00 2001
+From: mokopatches <mokopatches@openmoko.org>
+Date: Sun, 13 Apr 2008 07:23:57 +0100
+Subject: [PATCH] fix-hwecc-2410.patch
+ S3C24xx ECC mis-calculates the bit to flip:
+ http://lists.infradead.org/pipermail/linux-mtd/2007-October/019586.html
+ If the error couldn't be corrected, we returned "no problem" :-(
+ http://lists.infradead.org/pipermail/linux-mtd/2007-October/019615.html
+
+Signed-off-by: Werner Almesberger <werner@openmoko.org>
+---
+ drivers/mtd/nand/s3c2410.c | 28 +++++++++++++---------------
+ 1 files changed, 13 insertions(+), 15 deletions(-)
+
+diff --git a/drivers/mtd/nand/s3c2410.c b/drivers/mtd/nand/s3c2410.c
+index f83bed9..f7dd4e0 100644
+--- a/drivers/mtd/nand/s3c2410.c
++++ b/drivers/mtd/nand/s3c2410.c
+@@ -364,23 +364,21 @@ static int s3c2410_nand_correct_data(struct mtd_info *mtd, u_char *dat,
+ ((diff2 ^ (diff2 >> 1)) & 0x55) == 0x55) {
+ /* calculate the bit position of the error */
+
+- bit = (diff2 >> 2) & 1;
+- bit |= (diff2 >> 3) & 2;
+- bit |= (diff2 >> 4) & 4;
++ bit = ((diff2 >> 3) & 1) |
++ ((diff2 >> 4) & 2) |
++ ((diff2 >> 5) & 4);
+
+ /* calculate the byte position of the error */
+
+- byte = (diff1 << 1) & 0x80;
+- byte |= (diff1 << 2) & 0x40;
+- byte |= (diff1 << 3) & 0x20;
+- byte |= (diff1 << 4) & 0x10;
+-
+- byte |= (diff0 >> 3) & 0x08;
+- byte |= (diff0 >> 2) & 0x04;
+- byte |= (diff0 >> 1) & 0x02;
+- byte |= (diff0 >> 0) & 0x01;
+-
+- byte |= (diff2 << 8) & 0x100;
++ byte = ((diff2 << 7) & 0x100) |
++ ((diff1 << 0) & 0x80) |
++ ((diff1 << 1) & 0x40) |
++ ((diff1 << 2) & 0x20) |
++ ((diff1 << 3) & 0x10) |
++ ((diff0 >> 4) & 0x08) |
++ ((diff0 >> 3) & 0x04) |
++ ((diff0 >> 2) & 0x02) |
++ ((diff0 >> 1) & 0x01);
+
+ dev_dbg(info->device, "correcting error bit %d, byte %d\n",
+ bit, byte);
+@@ -399,7 +397,7 @@ static int s3c2410_nand_correct_data(struct mtd_info *mtd, u_char *dat,
+ if ((diff0 & ~(1<<fls(diff0))) == 0)
+ return 1;
+
+- return 0;
++ return -EBADMSG;
+ }
+
+ /* ECC functions
+--
+1.5.6.5
+