edac: create top-level debugfs directory
Create a single, top-level "edac" directory for debugfs. An "mc[0-N]" directory is then created for each memory controller. Individual drivers can create additional entries such as h/w error injection control. Signed-off-by: Rob Herring <rob.herring@calxeda.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
parent
c10538396b
commit
e7930ba49e
3 changed files with 39 additions and 1 deletions
|
@ -899,13 +899,33 @@ static struct device_type mci_attr_type = {
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef CONFIG_EDAC_DEBUG
|
#ifdef CONFIG_EDAC_DEBUG
|
||||||
|
static struct dentry *edac_debugfs;
|
||||||
|
|
||||||
|
int __init edac_debugfs_init(void)
|
||||||
|
{
|
||||||
|
edac_debugfs = debugfs_create_dir("edac", NULL);
|
||||||
|
if (IS_ERR(edac_debugfs)) {
|
||||||
|
edac_debugfs = NULL;
|
||||||
|
return -ENOMEM;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void __exit edac_debugfs_exit(void)
|
||||||
|
{
|
||||||
|
debugfs_remove(edac_debugfs);
|
||||||
|
}
|
||||||
|
|
||||||
int edac_create_debug_nodes(struct mem_ctl_info *mci)
|
int edac_create_debug_nodes(struct mem_ctl_info *mci)
|
||||||
{
|
{
|
||||||
struct dentry *d, *parent;
|
struct dentry *d, *parent;
|
||||||
char name[80];
|
char name[80];
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
d = debugfs_create_dir(mci->dev.kobj.name, mci->debugfs);
|
if (!edac_debugfs)
|
||||||
|
return -ENODEV;
|
||||||
|
|
||||||
|
d = debugfs_create_dir(mci->dev.kobj.name, edac_debugfs);
|
||||||
if (!d)
|
if (!d)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
parent = d;
|
parent = d;
|
||||||
|
@ -930,6 +950,7 @@ int edac_create_debug_nodes(struct mem_ctl_info *mci)
|
||||||
if (!d)
|
if (!d)
|
||||||
goto nomem;
|
goto nomem;
|
||||||
|
|
||||||
|
mci->debugfs = parent;
|
||||||
return 0;
|
return 0;
|
||||||
nomem:
|
nomem:
|
||||||
debugfs_remove(mci->debugfs);
|
debugfs_remove(mci->debugfs);
|
||||||
|
|
|
@ -94,6 +94,8 @@ static int __init edac_init(void)
|
||||||
if (err)
|
if (err)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
|
edac_debugfs_init();
|
||||||
|
|
||||||
/* Setup/Initialize the workq for this core */
|
/* Setup/Initialize the workq for this core */
|
||||||
err = edac_workqueue_setup();
|
err = edac_workqueue_setup();
|
||||||
if (err) {
|
if (err) {
|
||||||
|
@ -118,6 +120,7 @@ static void __exit edac_exit(void)
|
||||||
/* tear down the various subsystems */
|
/* tear down the various subsystems */
|
||||||
edac_workqueue_teardown();
|
edac_workqueue_teardown();
|
||||||
edac_mc_sysfs_exit();
|
edac_mc_sysfs_exit();
|
||||||
|
edac_debugfs_exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -56,6 +56,20 @@ extern void edac_mc_reset_delay_period(int value);
|
||||||
|
|
||||||
extern void *edac_align_ptr(void **p, unsigned size, int n_elems);
|
extern void *edac_align_ptr(void **p, unsigned size, int n_elems);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* EDAC debugfs functions
|
||||||
|
*/
|
||||||
|
#ifdef CONFIG_EDAC_DEBUG
|
||||||
|
int edac_debugfs_init(void);
|
||||||
|
void edac_debugfs_exit(void);
|
||||||
|
#else
|
||||||
|
static inline int edac_debugfs_init(void)
|
||||||
|
{
|
||||||
|
return -ENODEV;
|
||||||
|
}
|
||||||
|
static inline void edac_debugfs_exit(void) {}
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* EDAC PCI functions
|
* EDAC PCI functions
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in a new issue