Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
276b824c
K
Kernel
项目概览
openeuler
/
Kernel
大约 1 年 前同步成功
通知
5
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
276b824c
编写于
7月 22, 2009
作者:
M
Mauro Carvalho Chehab
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
i7core_edac: some fixes at error injection code
Signed-off-by:
N
Mauro Carvalho Chehab
<
mchehab@redhat.com
>
上级
17cb7b0c
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
51 addition
and
53 deletion
+51
-53
drivers/edac/i7core_edac.c
drivers/edac/i7core_edac.c
+51
-53
未找到文件。
drivers/edac/i7core_edac.c
浏览文件 @
276b824c
...
...
@@ -32,9 +32,6 @@
#include "edac_core.h"
/* To use the new pci_[read/write]_config_qword instead of two dword */
#define USE_QWORD 0
/*
* Alter this version for the module when modifications are made
*/
...
...
@@ -473,7 +470,7 @@ static int get_dimm_config(struct mem_ctl_info *mci, int *csrow, u8 socket)
"x%x x 0x%x
\n
"
,
numdimms
(
pvt
->
info
.
max_dod
),
numrank
(
pvt
->
info
.
max_dod
>>
2
),
numbank
(
pvt
->
info
.
max_dod
>>
4
)
);
numbank
(
pvt
->
info
.
max_dod
>>
4
)
,
numrow
(
pvt
->
info
.
max_dod
>>
6
),
numcol
(
pvt
->
info
.
max_dod
>>
9
));
...
...
@@ -646,7 +643,7 @@ static ssize_t i7core_inject_socket_store(struct mem_ctl_info *mci,
int
rc
;
rc
=
strict_strtoul
(
data
,
10
,
&
value
);
if
((
rc
<
0
)
||
(
value
>
pvt
->
sockets
))
if
((
rc
<
0
)
||
(
value
>
=
pvt
->
sockets
))
return
0
;
pvt
->
inject
.
section
=
(
u32
)
value
;
...
...
@@ -803,7 +800,7 @@ static ssize_t i7core_inject_addrmatch_store(struct mem_ctl_info *mci,
else
return
cmd
-
data
;
}
else
if
(
!
strcasecmp
(
cmd
,
"dimm"
))
{
if
(
value
<
4
)
if
(
value
<
3
)
pvt
->
inject
.
dimm
=
value
;
else
return
cmd
-
data
;
...
...
@@ -813,7 +810,7 @@ static ssize_t i7core_inject_addrmatch_store(struct mem_ctl_info *mci,
else
return
cmd
-
data
;
}
else
if
(
!
strcasecmp
(
cmd
,
"bank"
))
{
if
(
value
<
4
)
if
(
value
<
32
)
pvt
->
inject
.
bank
=
value
;
else
return
cmd
-
data
;
...
...
@@ -870,6 +867,28 @@ static ssize_t i7core_inject_addrmatch_show(struct mem_ctl_info *mci,
channel
,
dimm
,
bank
,
rank
,
page
,
col
);
}
static
int
write_and_test
(
struct
pci_dev
*
dev
,
int
where
,
u32
val
)
{
u32
read
;
int
count
;
for
(
count
=
0
;
count
<
10
;
count
++
)
{
if
(
count
)
msleep
(
100
);
pci_write_config_dword
(
dev
,
where
,
val
);
pci_read_config_dword
(
dev
,
where
,
&
read
);
if
(
read
==
val
)
return
0
;
}
debugf0
(
"Error Injection Register 0x%02x: Tried to write 0x%08x, "
"but read: 0x%08x
\n
"
,
where
,
val
,
read
);
return
-
EINVAL
;
}
/*
* This routine prepares the Memory Controller for error injection.
* The error will be injected when some process tries to write to the
...
...
@@ -949,70 +968,49 @@ static ssize_t i7core_inject_enable_store(struct mem_ctl_info *mci,
else
mask
|=
(
pvt
->
inject
.
col
&
0x3fffL
);
/* Unlock writes to registers */
/*
* bit 0: REPEAT_EN
* bits 1-2: MASK_HALF_CACHELINE
* bit 3: INJECT_ECC
* bit 4: INJECT_ADDR_PARITY
*/
injectmask
=
(
pvt
->
inject
.
type
&
1
)
|
(
pvt
->
inject
.
section
&
0x3
)
<<
1
|
(
pvt
->
inject
.
type
&
0x6
)
<<
(
3
-
1
);
/* Unlock writes to registers - this register is write only */
pci_write_config_dword
(
pvt
->
pci_noncore
[
pvt
->
inject
.
socket
],
MC_CFG_CONTROL
,
0x2
);
msleep
(
100
);
#if 0
/* Zeroes error count registers */
pci_write_config_dword(pvt->pci_mcr[pvt->inject.socket][4],
MC_TEST_ERR_RCV1, 0);
pci_write_config_dword(pvt->pci_mcr[pvt->inject.socket][4],
MC_TEST_ERR_RCV0, 0);
pvt->ce_count_available[pvt->inject.socket] = 0;
#endif
#if USE_QWORD
pci_write_config_qword
(
pvt
->
pci_ch
[
pvt
->
inject
.
socket
][
pvt
->
inject
.
channel
][
0
],
write_and_test
(
pvt
->
pci_ch
[
pvt
->
inject
.
socket
][
pvt
->
inject
.
channel
][
0
],
MC_CHANNEL_ADDR_MATCH
,
mask
);
#else
pci_write_config_dword
(
pvt
->
pci_ch
[
pvt
->
inject
.
socket
][
pvt
->
inject
.
channel
][
0
],
MC_CHANNEL_ADDR_MATCH
,
mask
);
pci_write_config_dword
(
pvt
->
pci_ch
[
pvt
->
inject
.
socket
][
pvt
->
inject
.
channel
][
0
],
write_and_test
(
pvt
->
pci_ch
[
pvt
->
inject
.
socket
][
pvt
->
inject
.
channel
][
0
],
MC_CHANNEL_ADDR_MATCH
+
4
,
mask
>>
32L
);
#endif
#if 1
#if USE_QWORD
u64
rdmask
;
pci_read_config_qword
(
pvt
->
pci_ch
[
pvt
->
inject
.
socket
][
pvt
->
inject
.
channel
][
0
],
MC_CHANNEL_ADDR_MATCH
,
&
rdmask
);
debugf0
(
"Inject addr match write 0x%016llx, read: 0x%016llx
\n
"
,
mask
,
rdmask
);
#else
u32
rdmask1
,
rdmask2
;
pci_read_config_dword
(
pvt
->
pci_ch
[
pvt
->
inject
.
socket
][
pvt
->
inject
.
channel
][
0
],
MC_CHANNEL_ADDR_MATCH
,
&
rdmask1
);
pci_read_config_dword
(
pvt
->
pci_ch
[
pvt
->
inject
.
socket
][
pvt
->
inject
.
channel
][
0
],
MC_CHANNEL_ADDR_MATCH
+
4
,
&
rdmask2
);
debugf0
(
"Inject addr match write 0x%016llx, read: 0x%08x 0x%08x
\n
"
,
mask
,
rdmask1
,
rdmask2
);
#endif
#endif
pci_write_config_dword
(
pvt
->
pci_ch
[
pvt
->
inject
.
socket
][
pvt
->
inject
.
channel
][
0
],
write_and_test
(
pvt
->
pci_ch
[
pvt
->
inject
.
socket
][
pvt
->
inject
.
channel
][
0
],
MC_CHANNEL_ERROR_MASK
,
pvt
->
inject
.
eccmask
);
write_and_test
(
pvt
->
pci_ch
[
pvt
->
inject
.
socket
][
pvt
->
inject
.
channel
][
0
],
MC_CHANNEL_ERROR_MASK
,
injectmask
);
/*
* bit 0: REPEAT_EN
* bits 1-2: MASK_HALF_CACHELINE
* bit 3: INJECT_ECC
* bit 4: INJECT_ADDR_PARITY
* This is something undocumented, based on my tests
* Without writing 8 to this register, errors aren't injected. Not sure
* why.
*/
pci_write_config_dword
(
pvt
->
pci_noncore
[
pvt
->
inject
.
socket
],
MC_CFG_CONTROL
,
8
);
injectmask
=
(
pvt
->
inject
.
type
&
1
)
|
(
pvt
->
inject
.
section
&
0x3
)
<<
1
|
(
pvt
->
inject
.
type
&
0x6
)
<<
(
3
-
1
);
pci_write_config_dword
(
pvt
->
pci_ch
[
pvt
->
inject
.
socket
][
pvt
->
inject
.
channel
][
0
],
MC_CHANNEL_ERROR_MASK
,
injectmask
);
#if 0
/* lock writes to registers */
pci_write_config_dword(pvt->pci_noncore, MC_CFG_CONTROL, 0);
#endif
debugf0
(
"Error inject addr match 0x%016llx, ecc 0x%08x,"
" inject 0x%08x
\n
"
,
mask
,
pvt
->
inject
.
eccmask
,
injectmask
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录