diff options
author | Dave Jiang <djiang@mvista.com> | 2007-07-19 04:49:54 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-19 13:04:54 -0400 |
commit | 4de78c6877ec21142582ac19453c2d453d1ea298 (patch) | |
tree | 784a1e007bea40744b93d4e0a09131e107fb6522 /drivers/edac/edac_pci_sysfs.c | |
parent | 66ee2f940ac8ab25f0c43a1e717d25dc46bfe74d (diff) |
drivers/edac: mod PCI poll names
Fixup poll values for MC and PCI.
Also make mc function names unique to mc.
Signed-off-by: Dave Jiang <djiang@mvista.com>
Signed-off-by: Douglas Thompson <dougthompson@xmissin.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/edac/edac_pci_sysfs.c')
-rw-r--r-- | drivers/edac/edac_pci_sysfs.c | 56 |
1 files changed, 44 insertions, 12 deletions
diff --git a/drivers/edac/edac_pci_sysfs.c b/drivers/edac/edac_pci_sysfs.c index 0b179e0fd112..a3f81d72c950 100644 --- a/drivers/edac/edac_pci_sysfs.c +++ b/drivers/edac/edac_pci_sysfs.c | |||
@@ -19,15 +19,42 @@ | |||
19 | #define EDAC_PCI_SYMLINK "device" | 19 | #define EDAC_PCI_SYMLINK "device" |
20 | 20 | ||
21 | static int check_pci_errors = 0; /* default YES check PCI parity */ | 21 | static int check_pci_errors = 0; /* default YES check PCI parity */ |
22 | static int panic_on_pci_parity = 0; /* default no panic on PCI Parity */ | 22 | static int edac_pci_panic_on_pe = 0; /* default no panic on PCI Parity */ |
23 | static int log_pci_errs = 1; | 23 | static int edac_pci_log_pe = 1; /* log PCI parity errors */ |
24 | static int edac_pci_log_npe = 1; /* log PCI non-parity error errors */ | ||
24 | static atomic_t pci_parity_count = ATOMIC_INIT(0); | 25 | static atomic_t pci_parity_count = ATOMIC_INIT(0); |
25 | static atomic_t pci_nonparity_count = ATOMIC_INIT(0); | 26 | static atomic_t pci_nonparity_count = ATOMIC_INIT(0); |
27 | static int edac_pci_poll_msec = 1000; | ||
26 | 28 | ||
27 | static struct kobject edac_pci_kobj; /* /sys/devices/system/edac/pci */ | 29 | static struct kobject edac_pci_kobj; /* /sys/devices/system/edac/pci */ |
28 | static struct completion edac_pci_kobj_complete; | 30 | static struct completion edac_pci_kobj_complete; |
29 | static atomic_t edac_pci_sysfs_refcount = ATOMIC_INIT(0); | 31 | static atomic_t edac_pci_sysfs_refcount = ATOMIC_INIT(0); |
30 | 32 | ||
33 | int edac_pci_get_check_errors(void) | ||
34 | { | ||
35 | return check_pci_errors; | ||
36 | } | ||
37 | |||
38 | int edac_pci_get_log_pe(void) | ||
39 | { | ||
40 | return edac_pci_log_pe; | ||
41 | } | ||
42 | |||
43 | int edac_pci_get_log_npe(void) | ||
44 | { | ||
45 | return edac_pci_log_npe; | ||
46 | } | ||
47 | |||
48 | int edac_pci_get_panic_on_pe(void) | ||
49 | { | ||
50 | return edac_pci_panic_on_pe; | ||
51 | } | ||
52 | |||
53 | int edac_pci_get_poll_msec(void) | ||
54 | { | ||
55 | return edac_pci_poll_msec; | ||
56 | } | ||
57 | |||
31 | /**************************** EDAC PCI sysfs instance *******************/ | 58 | /**************************** EDAC PCI sysfs instance *******************/ |
32 | static ssize_t instance_pe_count_show(struct edac_pci_ctl_info *pci, char *data) | 59 | static ssize_t instance_pe_count_show(struct edac_pci_ctl_info *pci, char *data) |
33 | { | 60 | { |
@@ -222,9 +249,11 @@ static struct edac_pci_dev_attribute edac_pci_attr_##_name = { \ | |||
222 | /* PCI Parity control files */ | 249 | /* PCI Parity control files */ |
223 | EDAC_PCI_ATTR(check_pci_errors, S_IRUGO|S_IWUSR, edac_pci_int_show, | 250 | EDAC_PCI_ATTR(check_pci_errors, S_IRUGO|S_IWUSR, edac_pci_int_show, |
224 | edac_pci_int_store); | 251 | edac_pci_int_store); |
225 | EDAC_PCI_ATTR(log_pci_errs, S_IRUGO|S_IWUSR, edac_pci_int_show, | 252 | EDAC_PCI_ATTR(edac_pci_log_pe, S_IRUGO|S_IWUSR, edac_pci_int_show, |
253 | edac_pci_int_store); | ||
254 | EDAC_PCI_ATTR(edac_pci_log_npe, S_IRUGO|S_IWUSR, edac_pci_int_show, | ||
226 | edac_pci_int_store); | 255 | edac_pci_int_store); |
227 | EDAC_PCI_ATTR(panic_on_pci_parity, S_IRUGO|S_IWUSR, edac_pci_int_show, | 256 | EDAC_PCI_ATTR(edac_pci_panic_on_pe, S_IRUGO|S_IWUSR, edac_pci_int_show, |
228 | edac_pci_int_store); | 257 | edac_pci_int_store); |
229 | EDAC_PCI_ATTR(pci_parity_count, S_IRUGO, edac_pci_int_show, NULL); | 258 | EDAC_PCI_ATTR(pci_parity_count, S_IRUGO, edac_pci_int_show, NULL); |
230 | EDAC_PCI_ATTR(pci_nonparity_count, S_IRUGO, edac_pci_int_show, NULL); | 259 | EDAC_PCI_ATTR(pci_nonparity_count, S_IRUGO, edac_pci_int_show, NULL); |
@@ -232,8 +261,9 @@ EDAC_PCI_ATTR(pci_nonparity_count, S_IRUGO, edac_pci_int_show, NULL); | |||
232 | /* Base Attributes of the memory ECC object */ | 261 | /* Base Attributes of the memory ECC object */ |
233 | static struct edac_pci_dev_attribute *edac_pci_attr[] = { | 262 | static struct edac_pci_dev_attribute *edac_pci_attr[] = { |
234 | &edac_pci_attr_check_pci_errors, | 263 | &edac_pci_attr_check_pci_errors, |
235 | &edac_pci_attr_log_pci_errs, | 264 | &edac_pci_attr_edac_pci_log_pe, |
236 | &edac_pci_attr_panic_on_pci_parity, | 265 | &edac_pci_attr_edac_pci_log_npe, |
266 | &edac_pci_attr_edac_pci_panic_on_pe, | ||
237 | &edac_pci_attr_pci_parity_count, | 267 | &edac_pci_attr_pci_parity_count, |
238 | &edac_pci_attr_pci_nonparity_count, | 268 | &edac_pci_attr_pci_nonparity_count, |
239 | NULL, | 269 | NULL, |
@@ -529,7 +559,7 @@ void edac_pci_do_parity_check(void) | |||
529 | local_irq_restore(flags); | 559 | local_irq_restore(flags); |
530 | 560 | ||
531 | /* Only if operator has selected panic on PCI Error */ | 561 | /* Only if operator has selected panic on PCI Error */ |
532 | if (panic_on_pci_parity) { | 562 | if (edac_pci_get_panic_on_pe()) { |
533 | /* If the count is different 'after' from 'before' */ | 563 | /* If the count is different 'after' from 'before' */ |
534 | if (before_count != atomic_read(&pci_parity_count)) | 564 | if (before_count != atomic_read(&pci_parity_count)) |
535 | panic("EDAC: PCI Parity Error"); | 565 | panic("EDAC: PCI Parity Error"); |
@@ -549,7 +579,7 @@ void edac_pci_handle_pe(struct edac_pci_ctl_info *pci, const char *msg) | |||
549 | /* global PE counter incremented by edac_pci_do_parity_check() */ | 579 | /* global PE counter incremented by edac_pci_do_parity_check() */ |
550 | atomic_inc(&pci->counters.pe_count); | 580 | atomic_inc(&pci->counters.pe_count); |
551 | 581 | ||
552 | if (log_pci_errs) | 582 | if (edac_pci_get_log_pe()) |
553 | edac_pci_printk(pci, KERN_WARNING, | 583 | edac_pci_printk(pci, KERN_WARNING, |
554 | "Parity Error ctl: %s %d: %s\n", | 584 | "Parity Error ctl: %s %d: %s\n", |
555 | pci->ctl_name, pci->pci_idx, msg); | 585 | pci->ctl_name, pci->pci_idx, msg); |
@@ -568,7 +598,7 @@ void edac_pci_handle_npe(struct edac_pci_ctl_info *pci, const char *msg) | |||
568 | /* global NPE counter incremented by edac_pci_do_parity_check() */ | 598 | /* global NPE counter incremented by edac_pci_do_parity_check() */ |
569 | atomic_inc(&pci->counters.npe_count); | 599 | atomic_inc(&pci->counters.npe_count); |
570 | 600 | ||
571 | if (log_pci_errs) | 601 | if (edac_pci_get_log_npe()) |
572 | edac_pci_printk(pci, KERN_WARNING, | 602 | edac_pci_printk(pci, KERN_WARNING, |
573 | "Non-Parity Error ctl: %s %d: %s\n", | 603 | "Non-Parity Error ctl: %s %d: %s\n", |
574 | pci->ctl_name, pci->pci_idx, msg); | 604 | pci->ctl_name, pci->pci_idx, msg); |
@@ -585,8 +615,10 @@ EXPORT_SYMBOL_GPL(edac_pci_handle_npe); | |||
585 | * Define the PCI parameter to the module | 615 | * Define the PCI parameter to the module |
586 | */ | 616 | */ |
587 | module_param(check_pci_errors, int, 0644); | 617 | module_param(check_pci_errors, int, 0644); |
588 | MODULE_PARM_DESC(check_pci_errors, "Check for PCI bus parity errors: 0=off 1=on"); | 618 | MODULE_PARM_DESC(check_pci_errors, |
589 | module_param(panic_on_pci_parity, int, 0644); | 619 | "Check for PCI bus parity errors: 0=off 1=on"); |
590 | MODULE_PARM_DESC(panic_on_pci_parity, "Panic on PCI Bus Parity error: 0=off 1=on"); | 620 | module_param(edac_pci_panic_on_pe, int, 0644); |
621 | MODULE_PARM_DESC(edac_pci_panic_on_pe, | ||
622 | "Panic on PCI Bus Parity error: 0=off 1=on"); | ||
591 | 623 | ||
592 | #endif /* CONFIG_PCI */ | 624 | #endif /* CONFIG_PCI */ |