drivers/edac: add new nmi rescan
Provides a way for NMI reported errors on x86 to notify the EDAC subsystem pending ECC errors by writing to a software state variable. Here's the reworked patch. I added an EDAC stub to the kernel so we can have variables that are in the kernel even if EDAC is a module. I also implemented the idea of using the chip driver to select error detection mode via module parameter and eliminate the kernel compile option. Please review/test. Thx! Also, I only made changes to some of the chipset drivers since I am unfamiliar with the other ones. We can add similar changes as we go. Signed-off-by: Dave Jiang <djiang@mvista.com> Signed-off-by: Douglas Thompson <dougthompson@xmission.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
committed by
Linus Torvalds
parent
28f96eeafc
commit
c0d1217202
@ -1,6 +1,7 @@
|
||||
|
||||
#include <linux/freezer.h>
|
||||
#include <linux/kthread.h>
|
||||
#include <linux/edac.h>
|
||||
|
||||
#include "edac_mc.h"
|
||||
#include "edac_module.h"
|
||||
@ -101,6 +102,25 @@ static void do_edac_check(void)
|
||||
edac_pci_do_parity_check();
|
||||
}
|
||||
|
||||
/*
|
||||
* handler for EDAC to check if NMI type handler has asserted interrupt
|
||||
*/
|
||||
static int edac_assert_error_check_and_clear(void)
|
||||
{
|
||||
int vreg;
|
||||
|
||||
if(edac_op_state == EDAC_OPSTATE_POLL)
|
||||
return 1;
|
||||
|
||||
vreg = atomic_read(&edac_err_assert);
|
||||
if(vreg) {
|
||||
atomic_set(&edac_err_assert, 0);
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Action thread for EDAC to perform the POLL operations
|
||||
*/
|
||||
@ -109,8 +129,8 @@ static int edac_kernel_thread(void *arg)
|
||||
int msec;
|
||||
|
||||
while (!kthread_should_stop()) {
|
||||
|
||||
do_edac_check();
|
||||
if(edac_assert_error_check_and_clear())
|
||||
do_edac_check();
|
||||
|
||||
/* goto sleep for the interval */
|
||||
msec = (HZ * edac_get_poll_msec()) / 1000;
|
||||
|
Reference in New Issue
Block a user