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 | |
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>
-rw-r--r-- | drivers/edac/edac_core.h | 7 | ||||
-rw-r--r-- | drivers/edac/edac_mc.c | 21 | ||||
-rw-r--r-- | drivers/edac/edac_mc_sysfs.c | 76 | ||||
-rw-r--r-- | drivers/edac/edac_module.h | 7 | ||||
-rw-r--r-- | drivers/edac/edac_pci.c | 21 | ||||
-rw-r--r-- | drivers/edac/edac_pci_sysfs.c | 56 |
6 files changed, 111 insertions, 77 deletions
diff --git a/drivers/edac/edac_core.h b/drivers/edac/edac_core.h index febff4111428..5371e230a4ae 100644 --- a/drivers/edac/edac_core.h +++ b/drivers/edac/edac_core.h | |||
@@ -646,13 +646,6 @@ struct edac_pci_ctl_info { | |||
646 | 646 | ||
647 | int pci_idx; | 647 | int pci_idx; |
648 | 648 | ||
649 | /* Per instance controls for this edac_device */ | ||
650 | int check_parity_error; /* boolean for checking parity errs */ | ||
651 | int log_parity_error; /* boolean for logging parity errs */ | ||
652 | int panic_on_pe; /* boolean for panic'ing on a PE */ | ||
653 | unsigned poll_msec; /* number of milliseconds to poll interval */ | ||
654 | unsigned long delay; /* number of jiffies for poll_msec */ | ||
655 | |||
656 | struct sysdev_class *edac_class; /* pointer to class */ | 649 | struct sysdev_class *edac_class; /* pointer to class */ |
657 | 650 | ||
658 | /* the internal state of this controller instance */ | 651 | /* the internal state of this controller instance */ |
diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c index 7c952c68f0d6..2e8c198749a1 100644 --- a/drivers/edac/edac_mc.c +++ b/drivers/edac/edac_mc.c | |||
@@ -263,7 +263,8 @@ static void edac_mc_workq_function(void *ptr) | |||
263 | mutex_unlock(&mem_ctls_mutex); | 263 | mutex_unlock(&mem_ctls_mutex); |
264 | 264 | ||
265 | /* Reschedule */ | 265 | /* Reschedule */ |
266 | queue_delayed_work(edac_workqueue, &mci->work, edac_mc_get_poll_msec()); | 266 | queue_delayed_work(edac_workqueue, &mci->work, |
267 | msecs_to_jiffies(edac_mc_get_poll_msec())); | ||
267 | } | 268 | } |
268 | 269 | ||
269 | /* | 270 | /* |
@@ -611,7 +612,7 @@ void edac_mc_handle_ce(struct mem_ctl_info *mci, | |||
611 | return; | 612 | return; |
612 | } | 613 | } |
613 | 614 | ||
614 | if (edac_get_log_ce()) | 615 | if (edac_mc_get_log_ce()) |
615 | /* FIXME - put in DIMM location */ | 616 | /* FIXME - put in DIMM location */ |
616 | edac_mc_printk(mci, KERN_WARNING, | 617 | edac_mc_printk(mci, KERN_WARNING, |
617 | "CE page 0x%lx, offset 0x%lx, grain %d, syndrome " | 618 | "CE page 0x%lx, offset 0x%lx, grain %d, syndrome " |
@@ -646,7 +647,7 @@ EXPORT_SYMBOL_GPL(edac_mc_handle_ce); | |||
646 | 647 | ||
647 | void edac_mc_handle_ce_no_info(struct mem_ctl_info *mci, const char *msg) | 648 | void edac_mc_handle_ce_no_info(struct mem_ctl_info *mci, const char *msg) |
648 | { | 649 | { |
649 | if (edac_get_log_ce()) | 650 | if (edac_mc_get_log_ce()) |
650 | edac_mc_printk(mci, KERN_WARNING, | 651 | edac_mc_printk(mci, KERN_WARNING, |
651 | "CE - no information available: %s\n", msg); | 652 | "CE - no information available: %s\n", msg); |
652 | 653 | ||
@@ -690,14 +691,14 @@ void edac_mc_handle_ue(struct mem_ctl_info *mci, | |||
690 | pos += chars; | 691 | pos += chars; |
691 | } | 692 | } |
692 | 693 | ||
693 | if (edac_get_log_ue()) | 694 | if (edac_mc_get_log_ue()) |
694 | edac_mc_printk(mci, KERN_EMERG, | 695 | edac_mc_printk(mci, KERN_EMERG, |
695 | "UE page 0x%lx, offset 0x%lx, grain %d, row %d, " | 696 | "UE page 0x%lx, offset 0x%lx, grain %d, row %d, " |
696 | "labels \"%s\": %s\n", page_frame_number, | 697 | "labels \"%s\": %s\n", page_frame_number, |
697 | offset_in_page, mci->csrows[row].grain, row, labels, | 698 | offset_in_page, mci->csrows[row].grain, row, labels, |
698 | msg); | 699 | msg); |
699 | 700 | ||
700 | if (edac_get_panic_on_ue()) | 701 | if (edac_mc_get_panic_on_ue()) |
701 | panic("EDAC MC%d: UE page 0x%lx, offset 0x%lx, grain %d, " | 702 | panic("EDAC MC%d: UE page 0x%lx, offset 0x%lx, grain %d, " |
702 | "row %d, labels \"%s\": %s\n", mci->mc_idx, | 703 | "row %d, labels \"%s\": %s\n", mci->mc_idx, |
703 | page_frame_number, offset_in_page, | 704 | page_frame_number, offset_in_page, |
@@ -710,10 +711,10 @@ EXPORT_SYMBOL_GPL(edac_mc_handle_ue); | |||
710 | 711 | ||
711 | void edac_mc_handle_ue_no_info(struct mem_ctl_info *mci, const char *msg) | 712 | void edac_mc_handle_ue_no_info(struct mem_ctl_info *mci, const char *msg) |
712 | { | 713 | { |
713 | if (edac_get_panic_on_ue()) | 714 | if (edac_mc_get_panic_on_ue()) |
714 | panic("EDAC MC%d: Uncorrected Error", mci->mc_idx); | 715 | panic("EDAC MC%d: Uncorrected Error", mci->mc_idx); |
715 | 716 | ||
716 | if (edac_get_log_ue()) | 717 | if (edac_mc_get_log_ue()) |
717 | edac_mc_printk(mci, KERN_WARNING, | 718 | edac_mc_printk(mci, KERN_WARNING, |
718 | "UE - no information available: %s\n", msg); | 719 | "UE - no information available: %s\n", msg); |
719 | mci->ue_noinfo_count++; | 720 | mci->ue_noinfo_count++; |
@@ -776,13 +777,13 @@ void edac_mc_handle_fbd_ue(struct mem_ctl_info *mci, | |||
776 | chars = snprintf(pos, len + 1, "-%s", | 777 | chars = snprintf(pos, len + 1, "-%s", |
777 | mci->csrows[csrow].channels[channelb].label); | 778 | mci->csrows[csrow].channels[channelb].label); |
778 | 779 | ||
779 | if (edac_get_log_ue()) | 780 | if (edac_mc_get_log_ue()) |
780 | edac_mc_printk(mci, KERN_EMERG, | 781 | edac_mc_printk(mci, KERN_EMERG, |
781 | "UE row %d, channel-a= %d channel-b= %d " | 782 | "UE row %d, channel-a= %d channel-b= %d " |
782 | "labels \"%s\": %s\n", csrow, channela, channelb, | 783 | "labels \"%s\": %s\n", csrow, channela, channelb, |
783 | labels, msg); | 784 | labels, msg); |
784 | 785 | ||
785 | if (edac_get_panic_on_ue()) | 786 | if (edac_mc_get_panic_on_ue()) |
786 | panic("UE row %d, channel-a= %d channel-b= %d " | 787 | panic("UE row %d, channel-a= %d channel-b= %d " |
787 | "labels \"%s\": %s\n", csrow, channela, | 788 | "labels \"%s\": %s\n", csrow, channela, |
788 | channelb, labels, msg); | 789 | channelb, labels, msg); |
@@ -817,7 +818,7 @@ void edac_mc_handle_fbd_ce(struct mem_ctl_info *mci, | |||
817 | return; | 818 | return; |
818 | } | 819 | } |
819 | 820 | ||
820 | if (edac_get_log_ce()) | 821 | if (edac_mc_get_log_ce()) |
821 | /* FIXME - put in DIMM location */ | 822 | /* FIXME - put in DIMM location */ |
822 | edac_mc_printk(mci, KERN_WARNING, | 823 | edac_mc_printk(mci, KERN_WARNING, |
823 | "CE row %d, channel %d, label \"%s\": %s\n", | 824 | "CE row %d, channel %d, label \"%s\": %s\n", |
diff --git a/drivers/edac/edac_mc_sysfs.c b/drivers/edac/edac_mc_sysfs.c index 6b2217b741fb..7f8240f40db0 100644 --- a/drivers/edac/edac_mc_sysfs.c +++ b/drivers/edac/edac_mc_sysfs.c | |||
@@ -16,47 +16,44 @@ | |||
16 | #include "edac_module.h" | 16 | #include "edac_module.h" |
17 | 17 | ||
18 | /* MC EDAC Controls, setable by module parameter, and sysfs */ | 18 | /* MC EDAC Controls, setable by module parameter, and sysfs */ |
19 | static int log_ue = 1; | 19 | static int edac_mc_log_ue = 1; |
20 | static int log_ce = 1; | 20 | static int edac_mc_log_ce = 1; |
21 | static int panic_on_ue; | 21 | static int edac_mc_panic_on_ue = 0; |
22 | static int poll_msec = 1000; | 22 | static int edac_mc_poll_msec = 1000; |
23 | 23 | ||
24 | /* Getter functions for above */ | 24 | /* Getter functions for above */ |
25 | int edac_get_log_ue(void) | 25 | int edac_mc_get_log_ue(void) |
26 | { | 26 | { |
27 | return log_ue; | 27 | return edac_mc_log_ue; |
28 | } | 28 | } |
29 | 29 | ||
30 | int edac_get_log_ce(void) | 30 | int edac_mc_get_log_ce(void) |
31 | { | 31 | { |
32 | return log_ce; | 32 | return edac_mc_log_ce; |
33 | } | 33 | } |
34 | 34 | ||
35 | int edac_get_panic_on_ue(void) | 35 | int edac_mc_get_panic_on_ue(void) |
36 | { | 36 | { |
37 | return panic_on_ue; | 37 | return edac_mc_panic_on_ue; |
38 | } | 38 | } |
39 | 39 | ||
40 | /* this is temporary */ | 40 | /* this is temporary */ |
41 | int edac_mc_get_poll_msec(void) | 41 | int edac_mc_get_poll_msec(void) |
42 | { | 42 | { |
43 | return edac_get_poll_msec(); | 43 | return edac_mc_poll_msec; |
44 | } | ||
45 | |||
46 | int edac_get_poll_msec(void) | ||
47 | { | ||
48 | return poll_msec; | ||
49 | } | 44 | } |
50 | 45 | ||
51 | /* Parameter declarations for above */ | 46 | /* Parameter declarations for above */ |
52 | module_param(panic_on_ue, int, 0644); | 47 | module_param(edac_mc_panic_on_ue, int, 0644); |
53 | MODULE_PARM_DESC(panic_on_ue, "Panic on uncorrected error: 0=off 1=on"); | 48 | MODULE_PARM_DESC(edac_mc_panic_on_ue, "Panic on uncorrected error: 0=off 1=on"); |
54 | module_param(log_ue, int, 0644); | 49 | module_param(edac_mc_log_ue, int, 0644); |
55 | MODULE_PARM_DESC(log_ue, "Log uncorrectable error to console: 0=off 1=on"); | 50 | MODULE_PARM_DESC(edac_mc_log_ue, |
56 | module_param(log_ce, int, 0644); | 51 | "Log uncorrectable error to console: 0=off 1=on"); |
57 | MODULE_PARM_DESC(log_ce, "Log correctable error to console: 0=off 1=on"); | 52 | module_param(edac_mc_log_ce, int, 0644); |
58 | module_param(poll_msec, int, 0644); | 53 | MODULE_PARM_DESC(edac_mc_log_ce, |
59 | MODULE_PARM_DESC(poll_msec, "Polling period in milliseconds"); | 54 | "Log correctable error to console: 0=off 1=on"); |
55 | module_param(edac_mc_poll_msec, int, 0644); | ||
56 | MODULE_PARM_DESC(edac_mc_poll_msec, "Polling period in milliseconds"); | ||
60 | 57 | ||
61 | 58 | ||
62 | /* | 59 | /* |
@@ -187,17 +184,32 @@ static struct memctrl_dev_attribute attr_##_name = { \ | |||
187 | }; | 184 | }; |
188 | 185 | ||
189 | /* csrow<id> control files */ | 186 | /* csrow<id> control files */ |
190 | MEMCTRL_ATTR(panic_on_ue,S_IRUGO|S_IWUSR,memctrl_int_show,memctrl_int_store); | 187 | MEMCTRL_ATTR(edac_mc_panic_on_ue, |
191 | MEMCTRL_ATTR(log_ue,S_IRUGO|S_IWUSR,memctrl_int_show,memctrl_int_store); | 188 | S_IRUGO | S_IWUSR, |
192 | MEMCTRL_ATTR(log_ce,S_IRUGO|S_IWUSR,memctrl_int_show,memctrl_int_store); | 189 | memctrl_int_show, |
193 | MEMCTRL_ATTR(poll_msec,S_IRUGO|S_IWUSR,memctrl_int_show,memctrl_int_store); | 190 | memctrl_int_store); |
191 | |||
192 | MEMCTRL_ATTR(edac_mc_log_ue, | ||
193 | S_IRUGO|S_IWUSR, | ||
194 | memctrl_int_show, | ||
195 | memctrl_int_store); | ||
196 | |||
197 | MEMCTRL_ATTR(edac_mc_log_ce, | ||
198 | S_IRUGO|S_IWUSR, | ||
199 | memctrl_int_show, | ||
200 | memctrl_int_store); | ||
201 | |||
202 | MEMCTRL_ATTR(edac_mc_poll_msec, | ||
203 | S_IRUGO|S_IWUSR, | ||
204 | memctrl_int_show, | ||
205 | memctrl_int_store); | ||
194 | 206 | ||
195 | /* Base Attributes of the memory ECC object */ | 207 | /* Base Attributes of the memory ECC object */ |
196 | static struct memctrl_dev_attribute *memctrl_attr[] = { | 208 | static struct memctrl_dev_attribute *memctrl_attr[] = { |
197 | &attr_panic_on_ue, | 209 | &attr_edac_mc_panic_on_ue, |
198 | &attr_log_ue, | 210 | &attr_edac_mc_log_ue, |
199 | &attr_log_ce, | 211 | &attr_edac_mc_log_ce, |
200 | &attr_poll_msec, | 212 | &attr_edac_mc_poll_msec, |
201 | NULL, | 213 | NULL, |
202 | }; | 214 | }; |
203 | 215 | ||
diff --git a/drivers/edac/edac_module.h b/drivers/edac/edac_module.h index 22c52e43131d..ffd25bdf87fc 100644 --- a/drivers/edac/edac_module.h +++ b/drivers/edac/edac_module.h | |||
@@ -27,6 +27,9 @@ extern void edac_check_mc_devices(void); | |||
27 | extern int edac_get_log_ue(void); | 27 | extern int edac_get_log_ue(void); |
28 | extern int edac_get_log_ce(void); | 28 | extern int edac_get_log_ce(void); |
29 | extern int edac_get_panic_on_ue(void); | 29 | extern int edac_get_panic_on_ue(void); |
30 | extern int edac_mc_get_log_ue(void); | ||
31 | extern int edac_mc_get_log_ce(void); | ||
32 | extern int edac_mc_get_panic_on_ue(void); | ||
30 | extern int edac_get_poll_msec(void); | 33 | extern int edac_get_poll_msec(void); |
31 | extern int edac_mc_get_poll_msec(void); | 34 | extern int edac_mc_get_poll_msec(void); |
32 | 35 | ||
@@ -52,12 +55,16 @@ extern void edac_pci_do_parity_check(void); | |||
52 | extern void edac_pci_clear_parity_errors(void); | 55 | extern void edac_pci_clear_parity_errors(void); |
53 | extern int edac_sysfs_pci_setup(void); | 56 | extern int edac_sysfs_pci_setup(void); |
54 | extern void edac_sysfs_pci_teardown(void); | 57 | extern void edac_sysfs_pci_teardown(void); |
58 | extern int edac_pci_get_check_errors(void); | ||
59 | extern int edac_pci_get_poll_msec(void); | ||
55 | #else /* CONFIG_PCI */ | 60 | #else /* CONFIG_PCI */ |
56 | /* pre-process these away */ | 61 | /* pre-process these away */ |
57 | #define edac_pci_do_parity_check() | 62 | #define edac_pci_do_parity_check() |
58 | #define edac_pci_clear_parity_errors() | 63 | #define edac_pci_clear_parity_errors() |
59 | #define edac_sysfs_pci_setup() (0) | 64 | #define edac_sysfs_pci_setup() (0) |
60 | #define edac_sysfs_pci_teardown() | 65 | #define edac_sysfs_pci_teardown() |
66 | #define edac_pci_get_check_errors() | ||
67 | #define edac_pci_get_poll_msec() | ||
61 | #endif /* CONFIG_PCI */ | 68 | #endif /* CONFIG_PCI */ |
62 | 69 | ||
63 | 70 | ||
diff --git a/drivers/edac/edac_pci.c b/drivers/edac/edac_pci.c index 677c603f5596..9f4aaaaa4ed7 100644 --- a/drivers/edac/edac_pci.c +++ b/drivers/edac/edac_pci.c | |||
@@ -226,13 +226,14 @@ static void edac_pci_workq_function(void *ptr) | |||
226 | 226 | ||
227 | if ((pci->op_state == OP_RUNNING_POLL) && | 227 | if ((pci->op_state == OP_RUNNING_POLL) && |
228 | (pci->edac_check != NULL) && | 228 | (pci->edac_check != NULL) && |
229 | (pci->check_parity_error)) | 229 | (edac_pci_get_check_errors())) |
230 | pci->edac_check(pci); | 230 | pci->edac_check(pci); |
231 | 231 | ||
232 | edac_unlock_pci_list(); | 232 | edac_unlock_pci_list(); |
233 | 233 | ||
234 | /* Reschedule */ | 234 | /* Reschedule */ |
235 | queue_delayed_work(edac_workqueue, &pci->work, pci->delay); | 235 | queue_delayed_work(edac_workqueue, &pci->work, |
236 | msecs_to_jiffies(edac_pci_get_poll_msec())); | ||
236 | } | 237 | } |
237 | 238 | ||
238 | /* | 239 | /* |
@@ -245,15 +246,13 @@ static void edac_pci_workq_setup(struct edac_pci_ctl_info *pci, | |||
245 | { | 246 | { |
246 | debugf0("%s()\n", __func__); | 247 | debugf0("%s()\n", __func__); |
247 | 248 | ||
248 | pci->poll_msec = msec; | ||
249 | edac_calc_delay(pci); | ||
250 | |||
251 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) | 249 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) |
252 | INIT_DELAYED_WORK(&pci->work, edac_pci_workq_function); | 250 | INIT_DELAYED_WORK(&pci->work, edac_pci_workq_function); |
253 | #else | 251 | #else |
254 | INIT_WORK(&pci->work, edac_pci_workq_function, pci); | 252 | INIT_WORK(&pci->work, edac_pci_workq_function, pci); |
255 | #endif | 253 | #endif |
256 | queue_delayed_work(edac_workqueue, &pci->work, pci->delay); | 254 | queue_delayed_work(edac_workqueue, &pci->work, |
255 | msecs_to_jiffies(edac_pci_get_poll_msec())); | ||
257 | } | 256 | } |
258 | 257 | ||
259 | /* | 258 | /* |
@@ -390,16 +389,6 @@ struct edac_pci_ctl_info * edac_pci_del_device(struct device *dev) | |||
390 | } | 389 | } |
391 | EXPORT_SYMBOL_GPL(edac_pci_del_device); | 390 | EXPORT_SYMBOL_GPL(edac_pci_del_device); |
392 | 391 | ||
393 | static inline int edac_pci_get_log_pe(struct edac_pci_ctl_info *pci) | ||
394 | { | ||
395 | return pci->log_parity_error; | ||
396 | } | ||
397 | |||
398 | static inline int edac_pci_get_panic_on_pe(struct edac_pci_ctl_info *pci) | ||
399 | { | ||
400 | return pci->panic_on_pe; | ||
401 | } | ||
402 | |||
403 | void edac_pci_generic_check(struct edac_pci_ctl_info *pci) | 392 | void edac_pci_generic_check(struct edac_pci_ctl_info *pci) |
404 | { | 393 | { |
405 | edac_pci_do_parity_check(); | 394 | edac_pci_do_parity_check(); |
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 */ |