-
-/*
- * Check MC status every edac_get_poll_msec().
- * Check PCI status every edac_get_poll_msec() as well.
- *
- * This where the work gets done for edac.
- *
- * SMP safe, doesn't use NMI, and auto-rate-limits.
- */
-static void do_edac_check(void)
-{
- debugf3("%s()\n", __func__);
-
- /* perform the poll activities */
- edac_check_mc_devices();
- 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
- */
-static int edac_kernel_thread(void *arg)
-{
- int msec;
-
- while (!kthread_should_stop()) {
- if(edac_assert_error_check_and_clear())
- do_edac_check();
-
- /* goto sleep for the interval */
- msec = (HZ * edac_get_poll_msec()) / 1000;
- schedule_timeout_interruptible(msec);
- try_to_freeze();
- }
-
- return 0;
-}
-