Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
cc301b3a
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
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看板
提交
cc301b3a
编写于
9月 24, 2009
作者:
M
Mauro Carvalho Chehab
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
edac: store/show methods for device groups weren't working
Signed-off-by:
N
Mauro Carvalho Chehab
<
mchehab@redhat.com
>
上级
a5538e53
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
88 addition
and
9 deletion
+88
-9
drivers/edac/edac_core.h
drivers/edac/edac_core.h
+2
-0
drivers/edac/edac_mc_sysfs.c
drivers/edac/edac_mc_sysfs.c
+78
-7
drivers/edac/i7core_edac.c
drivers/edac/i7core_edac.c
+8
-2
未找到文件。
drivers/edac/edac_core.h
浏览文件 @
cc301b3a
...
...
@@ -345,6 +345,8 @@ struct mcidev_sysfs_group {
const
char
*
name
;
struct
mcidev_sysfs_attribute
*
mcidev_attr
;
struct
kobject
kobj
;
struct
mem_ctl_info
*
mci
;
/* the parent */
};
...
...
drivers/edac/edac_mc_sysfs.c
浏览文件 @
cc301b3a
...
...
@@ -557,6 +557,8 @@ static ssize_t mcidev_show(struct kobject *kobj, struct attribute *attr,
struct
mem_ctl_info
*
mem_ctl_info
=
to_mci
(
kobj
);
struct
mcidev_sysfs_attribute
*
mcidev_attr
=
to_mcidev_attr
(
attr
);
debugf1
(
"%s() mem_ctl_info %p
\n
"
,
__func__
,
mem_ctl_info
);
if
(
mcidev_attr
->
show
)
return
mcidev_attr
->
show
(
mem_ctl_info
,
buffer
);
...
...
@@ -569,6 +571,8 @@ static ssize_t mcidev_store(struct kobject *kobj, struct attribute *attr,
struct
mem_ctl_info
*
mem_ctl_info
=
to_mci
(
kobj
);
struct
mcidev_sysfs_attribute
*
mcidev_attr
=
to_mcidev_attr
(
attr
);
debugf1
(
"%s() mem_ctl_info %p
\n
"
,
__func__
,
mem_ctl_info
);
if
(
mcidev_attr
->
store
)
return
mcidev_attr
->
store
(
mem_ctl_info
,
buffer
,
count
);
...
...
@@ -726,32 +730,97 @@ void edac_mc_unregister_sysfs_main_kobj(struct mem_ctl_info *mci)
#define EDAC_DEVICE_SYMLINK "device"
#define grp_to_mci(k) (container_of(k, struct mcidev_sysfs_group, kobj)->mci)
/* MCI show/store functions for top most object */
static
ssize_t
inst_grp_show
(
struct
kobject
*
kobj
,
struct
attribute
*
attr
,
char
*
buffer
)
{
struct
mem_ctl_info
*
mem_ctl_info
=
grp_to_mci
(
kobj
);
struct
mcidev_sysfs_attribute
*
mcidev_attr
=
to_mcidev_attr
(
attr
);
debugf1
(
"%s() mem_ctl_info %p
\n
"
,
__func__
,
mem_ctl_info
);
if
(
mcidev_attr
->
show
)
return
mcidev_attr
->
show
(
mem_ctl_info
,
buffer
);
return
-
EIO
;
}
static
ssize_t
inst_grp_store
(
struct
kobject
*
kobj
,
struct
attribute
*
attr
,
const
char
*
buffer
,
size_t
count
)
{
struct
mem_ctl_info
*
mem_ctl_info
=
grp_to_mci
(
kobj
);
struct
mcidev_sysfs_attribute
*
mcidev_attr
=
to_mcidev_attr
(
attr
);
debugf1
(
"%s() mem_ctl_info %p
\n
"
,
__func__
,
mem_ctl_info
);
if
(
mcidev_attr
->
store
)
return
mcidev_attr
->
store
(
mem_ctl_info
,
buffer
,
count
);
return
-
EIO
;
}
/* No memory to release for this kobj */
static
void
edac_inst_grp_release
(
struct
kobject
*
kobj
)
{
struct
mcidev_sysfs_group
*
grp
;
struct
mem_ctl_info
*
mci
;
debugf1
(
"%s()
\n
"
,
__func__
);
grp
=
container_of
(
kobj
,
struct
mcidev_sysfs_group
,
kobj
);
mci
=
grp
->
mci
;
kobject_put
(
&
mci
->
edac_mci_kobj
);
}
/* Intermediate show/store table */
static
struct
sysfs_ops
inst_grp_ops
=
{
.
show
=
inst_grp_show
,
.
store
=
inst_grp_store
};
/* the kobj_type instance for a instance group */
static
struct
kobj_type
ktype_inst_grp
=
{
.
release
=
edac_inst_grp_release
,
.
sysfs_ops
=
&
inst_grp_ops
,
.
default_attrs
=
(
struct
attribute
**
)
default_csrow_attr
,
};
/*
* edac_create_mci_instance_attributes
* create MC driver specific attributes bellow an specified kobj
* This routine calls itself recursively, in order to create an entire
* object tree.
*/
static
int
edac_create_mci_instance_attributes
(
static
int
edac_create_mci_instance_attributes
(
struct
mem_ctl_info
*
mci
,
struct
mcidev_sysfs_attribute
*
sysfs_attrib
,
struct
kobject
*
kobj
)
{
int
err
;
debugf1
(
"%s()
\n
"
,
__func__
);
while
(
sysfs_attrib
)
{
if
(
sysfs_attrib
->
grp
)
{
struct
kobject
*
newkobj
=
&
sysfs_attrib
->
grp
->
kobj
;
debugf0
(
"%s() grp %s
\n
"
,
__func__
,
sysfs_attrib
->
grp
->
name
);
debugf0
(
"%s() grp %s, mci %p
\n
"
,
__func__
,
sysfs_attrib
->
grp
->
name
,
mci
);
sysfs_attrib
->
grp
->
mci
=
mci
;
err
=
kobject_init_and_add
(
newkobj
,
NULL
,
err
=
kobject_init_and_add
(
newkobj
,
&
ktype_inst_grp
,
kobj
,
sysfs_attrib
->
grp
->
name
);
if
(
err
)
return
err
;
err
=
edac_create_mci_instance_attributes
(
sysfs_attrib
->
grp
->
mcidev_attr
,
newkobj
);
err
=
edac_create_mci_instance_attributes
(
mci
,
sysfs_attrib
->
grp
->
mcidev_attr
,
newkobj
);
if
(
err
)
return
err
;
}
else
if
(
sysfs_attrib
->
attr
.
name
)
{
...
...
@@ -780,6 +849,8 @@ static void edac_remove_mci_instance_attributes(
struct
mcidev_sysfs_attribute
*
sysfs_attrib
,
struct
kobject
*
kobj
)
{
debugf1
(
"%s()
\n
"
,
__func__
);
/* loop if there are attributes and until we hit a NULL entry */
while
(
sysfs_attrib
)
{
if
(
sysfs_attrib
->
grp
)
{
...
...
@@ -832,7 +903,7 @@ int edac_create_sysfs_mci_device(struct mem_ctl_info *mci)
* then create them now for the driver.
*/
if
(
mci
->
mc_driver_sysfs_attributes
)
{
err
=
edac_create_mci_instance_attributes
(
err
=
edac_create_mci_instance_attributes
(
mci
,
mci
->
mc_driver_sysfs_attributes
,
&
mci
->
edac_mci_kobj
);
if
(
err
)
{
...
...
drivers/edac/i7core_edac.c
浏览文件 @
cc301b3a
...
...
@@ -784,10 +784,13 @@ static ssize_t i7core_inject_store_##param( \
struct mem_ctl_info *mci, \
const char *data, size_t count) \
{ \
struct i7core_pvt *pvt
= mci->pvt_info;
\
struct i7core_pvt *pvt
;
\
long value; \
int rc; \
\
debugf1("%s()\n", __func__); \
pvt = mci->pvt_info; \
\
if (pvt->inject.enable) \
disable_inject(mci); \
\
...
...
@@ -808,7 +811,10 @@ static ssize_t i7core_inject_show_##param( \
struct mem_ctl_info *mci, \
char *data) \
{ \
struct i7core_pvt *pvt = mci->pvt_info; \
struct i7core_pvt *pvt; \
\
pvt = mci->pvt_info; \
debugf1("%s() pvt=%p\n", __func__, pvt); \
if (pvt->inject.param < 0) \
return sprintf(data, "any\n"); \
else \
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录