ecc校验问题 根本原因:板卡在进行读写操作的时候,对数据进行读取,写入等操作的时候,受到外界干扰,包括但不限于静电干扰,温度干扰等,造成数据错误,产生位反转(nand本身特性导致) ecc功能:在系统进行读取数据时进行校验,如果发现错误数据,进行纠正后再给读取方(并不会修改错误数据,错误数据仍然存在) 报错原因:数据出错产生位反转,ecc校验整个块数据的时候(单次检验512B数据),如果block的最后一个512B分区出现位错误,就会导致错误数据无法纠正,校验功能失效 错误现象: [ 4.961280] elm_decode_bch_error 113
[ 4.965121] reg_val 101
[ 4.967686] elm_decode_bch_error 148
[ 4.971440] fix errro bit_pos 1 byte_pos 4 [ 6.274353] [<c00be1c4>] (do_mount+0x0/0x6d8) from [<c00be9a0>] (sys_mount+0x8c/0xcc)
[ 6.282582] [<c00be914>] (sys_mount+0x0/0xcc) from [<c04c2c28>] (do_mount_root+0x30/0xbc)
[ 6.291163] r7:00008000 r6:df171000 r5:c04efa3c r4:df171000
[ 6.297119] [<c04c2bf8>] (do_mount_root+0x0/0xbc) from [<c04c2db0>] (mount_block_root+0xfc/0x228)
[ 6.306426] r6:df171000 r5:c04efa3c r4:df171000
[ 6.311295] [<c04c2cb4>] (mount_block_root+0x0/0x228) from [<c04c3154>] (prepare_namespace+0xac/0x1d4)
[ 6.321068] [<c04c30a8>] (prepare_namespace+0x0/0x1d4) from [<c04c2a90>] (kernel_init+0x124/0x130)
[ 6.330469] r5:c0519e1c r4:c0519e1c
[ 6.334229] [<c04c296c>] (kernel_init+0x0/0x130) from [<c00410e0>] (do_exit+0x0/0x668)
[ 6.342537] r5:c04c296c r4:00000000 解决方法:优化ecc校验逻辑,但是本身校验能力有限,错误数据太多,就只能重新烧写了 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c@@ -1587,8 +1587,8 @@ static int nand_do_read_ops(struct mtd_info *mtd, loff_t from, if (oob) ops->oobretlen = ops->ooblen - oobreadlen; - //if (ret) - // return ret; + if (ret<0) + return ret; |
|小黑屋| 飞凌嵌入式 ( 冀ICP备12004394号-1 )
GMT+8, 2024-11-22 11:29
Powered by Discuz! X3.4
© 2001-2013 Comsenz Inc.