Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
7608194c
cloud-kernel
项目概览
openanolis
/
cloud-kernel
大约 1 年 前同步成功
通知
158
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
7608194c
编写于
10月 27, 2006
作者:
D
David Woodhouse
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[MTD] NAND: Add ECC debugging for CAFÉ
Signed-off-by:
N
David Woodhouse
<
dwmw2@infradead.org
>
上级
b478c775
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
36 addition
and
3 deletion
+36
-3
drivers/mtd/nand/cafe_ecc.c
drivers/mtd/nand/cafe_ecc.c
+36
-3
未找到文件。
drivers/mtd/nand/cafe_ecc.c
浏览文件 @
7608194c
...
...
@@ -19,6 +19,7 @@
*/
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/errno.h>
static
unsigned
short
gf4096_mul
(
unsigned
short
,
unsigned
short
);
...
...
@@ -1322,16 +1323,43 @@ void correct_12bit_symbol(unsigned char *buf, unsigned short sym,
buf
[
2
+
(
3
*
(
sym
-
2
))
/
2
]
^=
(
val
>>
8
);
buf
[
3
+
(
3
*
(
sym
-
2
))
/
2
]
^=
(
val
&
0xff
);
}
}
static
int
debugecc
=
0
;
module_param
(
debugecc
,
int
,
0644
);
int
cafe_correct_ecc
(
unsigned
char
*
buf
,
unsigned
short
*
chk_syndrome_list
)
{
unsigned
short
err_info
[
9
];
int
i
;
if
(
debugecc
)
{
printk
(
KERN_WARNING
"cafe_correct_ecc invoked. Syndromes %x %x %x %x %x %x %x %x
\n
"
,
chk_syndrome_list
[
0
],
chk_syndrome_list
[
1
],
chk_syndrome_list
[
2
],
chk_syndrome_list
[
3
],
chk_syndrome_list
[
4
],
chk_syndrome_list
[
5
],
chk_syndrome_list
[
6
],
chk_syndrome_list
[
7
]);
for
(
i
=
0
;
i
<
2048
;
i
+=
16
)
{
printk
(
KERN_WARNING
"D %04x: %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x
\n
"
,
i
,
buf
[
i
],
buf
[
i
+
1
],
buf
[
i
+
2
],
buf
[
i
+
3
],
buf
[
i
+
4
],
buf
[
i
+
5
],
buf
[
i
+
6
],
buf
[
i
+
7
],
buf
[
i
+
8
],
buf
[
i
+
9
],
buf
[
i
+
10
],
buf
[
i
+
11
],
buf
[
i
+
12
],
buf
[
i
+
13
],
buf
[
i
+
14
],
buf
[
i
+
15
]);
}
for
(
;
i
<
2112
;
i
+=
16
)
{
printk
(
KERN_WARNING
"O %02x: %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x
\n
"
,
i
-
2048
,
buf
[
i
],
buf
[
i
+
1
],
buf
[
i
+
2
],
buf
[
i
+
3
],
buf
[
i
+
4
],
buf
[
i
+
5
],
buf
[
i
+
6
],
buf
[
i
+
7
],
buf
[
i
+
8
],
buf
[
i
+
9
],
buf
[
i
+
10
],
buf
[
i
+
11
],
buf
[
i
+
12
],
buf
[
i
+
13
],
buf
[
i
+
14
],
buf
[
i
+
15
]);
}
}
if
(
chk_no_err_only
(
chk_syndrome_list
,
err_info
)
&&
chk_1_err_only
(
chk_syndrome_list
,
err_info
)
&&
chk_2_err_only
(
chk_syndrome_list
,
err_info
)
&&
...
...
@@ -1340,8 +1368,13 @@ int cafe_correct_ecc(unsigned char *buf,
return
-
EIO
;
}
for
(
i
=
0
;
i
<
err_info
[
0
];
i
++
)
for
(
i
=
0
;
i
<
err_info
[
0
];
i
++
)
{
if
(
debugecc
)
printk
(
KERN_WARNING
"Correct symbol %d with 0x%03x
\n
"
,
err_info
[
1
+
i
],
err_info
[
5
+
i
]);
correct_12bit_symbol
(
buf
,
err_info
[
1
+
i
],
err_info
[
5
+
i
]);
}
return
err_info
[
0
];
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录