Skip to content

Commit

Permalink
[PATCH] EDAC: disable sysfs interface
Browse files Browse the repository at this point in the history
- Disable the EDAC sysfs code.  The sysfs interface that EDAC presents to
  user space needs more thought, and is likely to change substantially.
  Therefore disable it for now so users don't start depending on it in its
  current form.

- Disable the default behavior of calling panic() when an uncorrectible
  error is detected (since for now, there is no sysfs interface that allows
  the user to configure this behavior).

Signed-off-by: David S. Peterson <dsp@llnl.gov>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Dave Peterson authored and Linus Torvalds committed Mar 14, 2006
1 parent 30f4e20 commit ceb2ca9
Showing 1 changed file with 42 additions and 2 deletions.
44 changes: 42 additions & 2 deletions drivers/edac/edac_mc.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@

#define EDAC_MC_VERSION "edac_mc Ver: 2.0.0 " __DATE__

/* For now, disable the EDAC sysfs code. The sysfs interface that EDAC
* presents to user space needs more thought, and is likely to change
* substantially.
*/
#define DISABLE_EDAC_SYSFS

#ifdef CONFIG_EDAC_DEBUG
/* Values of 0 to 4 will generate output */
int edac_debug_level = 1;
Expand All @@ -47,7 +53,7 @@ EXPORT_SYMBOL(edac_debug_level);
/* EDAC Controls, setable by module parameter, and sysfs */
static int log_ue = 1;
static int log_ce = 1;
static int panic_on_ue = 1;
static int panic_on_ue;
static int poll_msec = 1000;

static int check_pci_parity = 0; /* default YES check PCI parity */
Expand Down Expand Up @@ -77,6 +83,8 @@ static int pci_whitelist_count ;

/* START sysfs data and methods */

#ifndef DISABLE_EDAC_SYSFS

static const char *mem_types[] = {
[MEM_EMPTY] = "Empty",
[MEM_RESERVED] = "Reserved",
Expand Down Expand Up @@ -241,6 +249,7 @@ static struct kobj_type ktype_memctrl = {
.default_attrs = (struct attribute **) memctrl_attr,
};

#endif /* DISABLE_EDAC_SYSFS */

/* Initialize the main sysfs entries for edac:
* /sys/devices/system/edac
Expand All @@ -251,6 +260,11 @@ static struct kobj_type ktype_memctrl = {
* !0 FAILURE
*/
static int edac_sysfs_memctrl_setup(void)
#ifdef DISABLE_EDAC_SYSFS
{
return 0;
}
#else
{
int err=0;

Expand Down Expand Up @@ -283,13 +297,15 @@ static int edac_sysfs_memctrl_setup(void)

return err;
}
#endif /* DISABLE_EDAC_SYSFS */

/*
* MC teardown:
* the '..../edac/mc' kobject followed by '..../edac' itself
*/
static void edac_sysfs_memctrl_teardown(void)
{
#ifndef DISABLE_EDAC_SYSFS
debugf0("MC: " __FILE__ ": %s()\n", __func__);

/* Unregister the MC's kobject */
Expand All @@ -300,8 +316,11 @@ static void edac_sysfs_memctrl_teardown(void)

/* Unregister the 'edac' object */
sysdev_class_unregister(&edac_class);
#endif /* DISABLE_EDAC_SYSFS */
}

#ifndef DISABLE_EDAC_SYSFS

/*
* /sys/devices/system/edac/pci;
* data structures and methods
Expand Down Expand Up @@ -554,11 +573,18 @@ static struct kobj_type ktype_edac_pci = {
.default_attrs = (struct attribute **) edac_pci_attr,
};

#endif /* DISABLE_EDAC_SYSFS */

/**
* edac_sysfs_pci_setup()
*
*/
static int edac_sysfs_pci_setup(void)
#ifdef DISABLE_EDAC_SYSFS
{
return 0;
}
#else
{
int err;

Expand All @@ -582,16 +608,20 @@ static int edac_sysfs_pci_setup(void)
}
return err;
}

#endif /* DISABLE_EDAC_SYSFS */

static void edac_sysfs_pci_teardown(void)
{
#ifndef DISABLE_EDAC_SYSFS
debugf0("MC: " __FILE__ ": %s()\n", __func__);

kobject_unregister(&edac_pci_kobj);
kobject_put(&edac_pci_kobj);
#endif
}

#ifndef DISABLE_EDAC_SYSFS

/* EDAC sysfs CSROW data structures and methods */

/* Set of more detailed csrow<id> attribute show/store functions */
Expand Down Expand Up @@ -1045,6 +1075,8 @@ static struct kobj_type ktype_mci = {
.default_attrs = (struct attribute **) mci_attr,
};

#endif /* DISABLE_EDAC_SYSFS */

#define EDAC_DEVICE_SYMLINK "device"

/*
Expand All @@ -1056,6 +1088,11 @@ static struct kobj_type ktype_mci = {
* !0 Failure
*/
static int edac_create_sysfs_mci_device(struct mem_ctl_info *mci)
#ifdef DISABLE_EDAC_SYSFS
{
return 0;
}
#else
{
int i;
int err;
Expand Down Expand Up @@ -1124,12 +1161,14 @@ static int edac_create_sysfs_mci_device(struct mem_ctl_info *mci)

return err;
}
#endif /* DISABLE_EDAC_SYSFS */

/*
* remove a Memory Controller instance
*/
static void edac_remove_sysfs_mci_device(struct mem_ctl_info *mci)
{
#ifndef DISABLE_EDAC_SYSFS
int i;

debugf0("MC: " __FILE__ ": %s()\n", __func__);
Expand All @@ -1146,6 +1185,7 @@ static void edac_remove_sysfs_mci_device(struct mem_ctl_info *mci)

kobject_unregister(&mci->edac_mci_kobj);
kobject_put(&mci->edac_mci_kobj);
#endif /* DISABLE_EDAC_SYSFS */
}

/* END OF sysfs data and methods */
Expand Down

0 comments on commit ceb2ca9

Please sign in to comment.