diff options
author | Dave Peterson <dsp@llnl.gov> | 2006-03-14 00:20:50 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-14 10:57:18 -0500 |
commit | ceb2ca9cb0bfd885127fa9a2c27127b3fe1c8f28 (patch) | |
tree | 3538a1d7f63c2ce8549958c95683e1e2922db7e3 | |
parent | 30f4e20a0d3492668f5065af582b5af2d1e4256b (diff) |
[PATCH] EDAC: disable sysfs interface
- 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>
-rw-r--r-- | drivers/edac/edac_mc.c | 44 |
1 files changed, 42 insertions, 2 deletions
diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c index 262e44544dc8..9c205274c1cb 100644 --- a/drivers/edac/edac_mc.c +++ b/drivers/edac/edac_mc.c | |||
@@ -38,6 +38,12 @@ | |||
38 | 38 | ||
39 | #define EDAC_MC_VERSION "edac_mc Ver: 2.0.0 " __DATE__ | 39 | #define EDAC_MC_VERSION "edac_mc Ver: 2.0.0 " __DATE__ |
40 | 40 | ||
41 | /* For now, disable the EDAC sysfs code. The sysfs interface that EDAC | ||
42 | * presents to user space needs more thought, and is likely to change | ||
43 | * substantially. | ||
44 | */ | ||
45 | #define DISABLE_EDAC_SYSFS | ||
46 | |||
41 | #ifdef CONFIG_EDAC_DEBUG | 47 | #ifdef CONFIG_EDAC_DEBUG |
42 | /* Values of 0 to 4 will generate output */ | 48 | /* Values of 0 to 4 will generate output */ |
43 | int edac_debug_level = 1; | 49 | int edac_debug_level = 1; |
@@ -47,7 +53,7 @@ EXPORT_SYMBOL(edac_debug_level); | |||
47 | /* EDAC Controls, setable by module parameter, and sysfs */ | 53 | /* EDAC Controls, setable by module parameter, and sysfs */ |
48 | static int log_ue = 1; | 54 | static int log_ue = 1; |
49 | static int log_ce = 1; | 55 | static int log_ce = 1; |
50 | static int panic_on_ue = 1; | 56 | static int panic_on_ue; |
51 | static int poll_msec = 1000; | 57 | static int poll_msec = 1000; |
52 | 58 | ||
53 | static int check_pci_parity = 0; /* default YES check PCI parity */ | 59 | static int check_pci_parity = 0; /* default YES check PCI parity */ |
@@ -77,6 +83,8 @@ static int pci_whitelist_count ; | |||
77 | 83 | ||
78 | /* START sysfs data and methods */ | 84 | /* START sysfs data and methods */ |
79 | 85 | ||
86 | #ifndef DISABLE_EDAC_SYSFS | ||
87 | |||
80 | static const char *mem_types[] = { | 88 | static const char *mem_types[] = { |
81 | [MEM_EMPTY] = "Empty", | 89 | [MEM_EMPTY] = "Empty", |
82 | [MEM_RESERVED] = "Reserved", | 90 | [MEM_RESERVED] = "Reserved", |
@@ -241,6 +249,7 @@ static struct kobj_type ktype_memctrl = { | |||
241 | .default_attrs = (struct attribute **) memctrl_attr, | 249 | .default_attrs = (struct attribute **) memctrl_attr, |
242 | }; | 250 | }; |
243 | 251 | ||
252 | #endif /* DISABLE_EDAC_SYSFS */ | ||
244 | 253 | ||
245 | /* Initialize the main sysfs entries for edac: | 254 | /* Initialize the main sysfs entries for edac: |
246 | * /sys/devices/system/edac | 255 | * /sys/devices/system/edac |
@@ -251,6 +260,11 @@ static struct kobj_type ktype_memctrl = { | |||
251 | * !0 FAILURE | 260 | * !0 FAILURE |
252 | */ | 261 | */ |
253 | static int edac_sysfs_memctrl_setup(void) | 262 | static int edac_sysfs_memctrl_setup(void) |
263 | #ifdef DISABLE_EDAC_SYSFS | ||
264 | { | ||
265 | return 0; | ||
266 | } | ||
267 | #else | ||
254 | { | 268 | { |
255 | int err=0; | 269 | int err=0; |
256 | 270 | ||
@@ -283,6 +297,7 @@ static int edac_sysfs_memctrl_setup(void) | |||
283 | 297 | ||
284 | return err; | 298 | return err; |
285 | } | 299 | } |
300 | #endif /* DISABLE_EDAC_SYSFS */ | ||
286 | 301 | ||
287 | /* | 302 | /* |
288 | * MC teardown: | 303 | * MC teardown: |
@@ -290,6 +305,7 @@ static int edac_sysfs_memctrl_setup(void) | |||
290 | */ | 305 | */ |
291 | static void edac_sysfs_memctrl_teardown(void) | 306 | static void edac_sysfs_memctrl_teardown(void) |
292 | { | 307 | { |
308 | #ifndef DISABLE_EDAC_SYSFS | ||
293 | debugf0("MC: " __FILE__ ": %s()\n", __func__); | 309 | debugf0("MC: " __FILE__ ": %s()\n", __func__); |
294 | 310 | ||
295 | /* Unregister the MC's kobject */ | 311 | /* Unregister the MC's kobject */ |
@@ -300,8 +316,11 @@ static void edac_sysfs_memctrl_teardown(void) | |||
300 | 316 | ||
301 | /* Unregister the 'edac' object */ | 317 | /* Unregister the 'edac' object */ |
302 | sysdev_class_unregister(&edac_class); | 318 | sysdev_class_unregister(&edac_class); |
319 | #endif /* DISABLE_EDAC_SYSFS */ | ||
303 | } | 320 | } |
304 | 321 | ||
322 | #ifndef DISABLE_EDAC_SYSFS | ||
323 | |||
305 | /* | 324 | /* |
306 | * /sys/devices/system/edac/pci; | 325 | * /sys/devices/system/edac/pci; |
307 | * data structures and methods | 326 | * data structures and methods |
@@ -554,11 +573,18 @@ static struct kobj_type ktype_edac_pci = { | |||
554 | .default_attrs = (struct attribute **) edac_pci_attr, | 573 | .default_attrs = (struct attribute **) edac_pci_attr, |
555 | }; | 574 | }; |
556 | 575 | ||
576 | #endif /* DISABLE_EDAC_SYSFS */ | ||
577 | |||
557 | /** | 578 | /** |
558 | * edac_sysfs_pci_setup() | 579 | * edac_sysfs_pci_setup() |
559 | * | 580 | * |
560 | */ | 581 | */ |
561 | static int edac_sysfs_pci_setup(void) | 582 | static int edac_sysfs_pci_setup(void) |
583 | #ifdef DISABLE_EDAC_SYSFS | ||
584 | { | ||
585 | return 0; | ||
586 | } | ||
587 | #else | ||
562 | { | 588 | { |
563 | int err; | 589 | int err; |
564 | 590 | ||
@@ -582,16 +608,20 @@ static int edac_sysfs_pci_setup(void) | |||
582 | } | 608 | } |
583 | return err; | 609 | return err; |
584 | } | 610 | } |
585 | 611 | #endif /* DISABLE_EDAC_SYSFS */ | |
586 | 612 | ||
587 | static void edac_sysfs_pci_teardown(void) | 613 | static void edac_sysfs_pci_teardown(void) |
588 | { | 614 | { |
615 | #ifndef DISABLE_EDAC_SYSFS | ||
589 | debugf0("MC: " __FILE__ ": %s()\n", __func__); | 616 | debugf0("MC: " __FILE__ ": %s()\n", __func__); |
590 | 617 | ||
591 | kobject_unregister(&edac_pci_kobj); | 618 | kobject_unregister(&edac_pci_kobj); |
592 | kobject_put(&edac_pci_kobj); | 619 | kobject_put(&edac_pci_kobj); |
620 | #endif | ||
593 | } | 621 | } |
594 | 622 | ||
623 | #ifndef DISABLE_EDAC_SYSFS | ||
624 | |||
595 | /* EDAC sysfs CSROW data structures and methods */ | 625 | /* EDAC sysfs CSROW data structures and methods */ |
596 | 626 | ||
597 | /* Set of more detailed csrow<id> attribute show/store functions */ | 627 | /* Set of more detailed csrow<id> attribute show/store functions */ |
@@ -1045,6 +1075,8 @@ static struct kobj_type ktype_mci = { | |||
1045 | .default_attrs = (struct attribute **) mci_attr, | 1075 | .default_attrs = (struct attribute **) mci_attr, |
1046 | }; | 1076 | }; |
1047 | 1077 | ||
1078 | #endif /* DISABLE_EDAC_SYSFS */ | ||
1079 | |||
1048 | #define EDAC_DEVICE_SYMLINK "device" | 1080 | #define EDAC_DEVICE_SYMLINK "device" |
1049 | 1081 | ||
1050 | /* | 1082 | /* |
@@ -1056,6 +1088,11 @@ static struct kobj_type ktype_mci = { | |||
1056 | * !0 Failure | 1088 | * !0 Failure |
1057 | */ | 1089 | */ |
1058 | static int edac_create_sysfs_mci_device(struct mem_ctl_info *mci) | 1090 | static int edac_create_sysfs_mci_device(struct mem_ctl_info *mci) |
1091 | #ifdef DISABLE_EDAC_SYSFS | ||
1092 | { | ||
1093 | return 0; | ||
1094 | } | ||
1095 | #else | ||
1059 | { | 1096 | { |
1060 | int i; | 1097 | int i; |
1061 | int err; | 1098 | int err; |
@@ -1124,12 +1161,14 @@ fail: | |||
1124 | 1161 | ||
1125 | return err; | 1162 | return err; |
1126 | } | 1163 | } |
1164 | #endif /* DISABLE_EDAC_SYSFS */ | ||
1127 | 1165 | ||
1128 | /* | 1166 | /* |
1129 | * remove a Memory Controller instance | 1167 | * remove a Memory Controller instance |
1130 | */ | 1168 | */ |
1131 | static void edac_remove_sysfs_mci_device(struct mem_ctl_info *mci) | 1169 | static void edac_remove_sysfs_mci_device(struct mem_ctl_info *mci) |
1132 | { | 1170 | { |
1171 | #ifndef DISABLE_EDAC_SYSFS | ||
1133 | int i; | 1172 | int i; |
1134 | 1173 | ||
1135 | debugf0("MC: " __FILE__ ": %s()\n", __func__); | 1174 | debugf0("MC: " __FILE__ ": %s()\n", __func__); |
@@ -1146,6 +1185,7 @@ static void edac_remove_sysfs_mci_device(struct mem_ctl_info *mci) | |||
1146 | 1185 | ||
1147 | kobject_unregister(&mci->edac_mci_kobj); | 1186 | kobject_unregister(&mci->edac_mci_kobj); |
1148 | kobject_put(&mci->edac_mci_kobj); | 1187 | kobject_put(&mci->edac_mci_kobj); |
1188 | #endif /* DISABLE_EDAC_SYSFS */ | ||
1149 | } | 1189 | } |
1150 | 1190 | ||
1151 | /* END OF sysfs data and methods */ | 1191 | /* END OF sysfs data and methods */ |