summaryrefslogtreecommitdiff
path: root/recipes/linux/linux-omap-psp-2.6.32/0043-MTD-silence-ecc-errors-on-mtdblock0.patch
blob: 7a3fde30ce297327db8d6af55221a30e65146b7c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
From 6678e3fcadf0e562b30798791d6396d7b57c3b7b Mon Sep 17 00:00:00 2001
From: Steve Sakoman <steve@sakoman.com>
Date: Mon, 26 Apr 2010 11:17:26 -0700
Subject: [PATCH 43/48] MTD: silence ecc errors on mtdblock0

mtdblock0 is the x-load partition, which uses hw ecc
this confuses linux, which uses sw ecc
this patch silences ecc error messages when linux peeks into mtdblock0
* not for upstream submission *
---
 block/blk-core.c            |    3 ++-
 drivers/mtd/nand/nand_ecc.c |    2 +-
 fs/buffer.c                 |    3 ++-
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/block/blk-core.c b/block/blk-core.c
index 718897e..c526fde 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -1970,7 +1970,8 @@ bool blk_update_request(struct request *req, int error, unsigned int nr_bytes)
 		req->errors = 0;
 
 	if (error && (blk_fs_request(req) && !(req->cmd_flags & REQ_QUIET))) {
-		printk(KERN_ERR "end_request: I/O error, dev %s, sector %llu\n",
+		if (req->rq_disk && (strcmp(req->rq_disk->disk_name, "mtdblock0") != 0))
+			printk(KERN_ERR "end_request: I/O error, dev %s, sector %llu\n",
 				req->rq_disk ? req->rq_disk->disk_name : "?",
 				(unsigned long long)blk_rq_pos(req));
 	}
diff --git a/drivers/mtd/nand/nand_ecc.c b/drivers/mtd/nand/nand_ecc.c
index 92320a6..2b86b6d 100644
--- a/drivers/mtd/nand/nand_ecc.c
+++ b/drivers/mtd/nand/nand_ecc.c
@@ -492,7 +492,7 @@ int __nand_correct_data(unsigned char *buf,
 	if ((bitsperbyte[b0] + bitsperbyte[b1] + bitsperbyte[b2]) == 1)
 		return 1;	/* error in ecc data; no action needed */
 
-	printk(KERN_ERR "uncorrectable error : ");
+//	printk(KERN_ERR "uncorrectable error : ");
 	return -1;
 }
 EXPORT_SYMBOL(__nand_correct_data);
diff --git a/fs/buffer.c b/fs/buffer.c
index 6fa5302..27b3103 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -114,7 +114,8 @@ static int quiet_error(struct buffer_head *bh)
 static void buffer_io_error(struct buffer_head *bh)
 {
 	char b[BDEVNAME_SIZE];
-	printk(KERN_ERR "Buffer I/O error on device %s, logical block %Lu\n",
+	if (strcmp(bdevname(bh->b_bdev, b), "mtdblock0") != 0)
+		printk(KERN_ERR "Buffer I/O error on device %s, logical block %Lu\n",
 			bdevname(bh->b_bdev, b),
 			(unsigned long long)bh->b_blocknr);
 }
-- 
1.6.6.1