Commit 66ee2f94 authored by Dave Jiang's avatar Dave Jiang Committed by Linus Torvalds

drivers/edac: mod assert_error check

Change error check and clear variable from an atomic to an int
Signed-off-by: default avatarDave Jiang <djiang@mvista.com>
Signed-off-by: Douglas Thompson <dougthompson@xmission.com
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 91b99041
...@@ -222,18 +222,15 @@ static struct mem_ctl_info *find_mci_by_dev(struct device *dev) ...@@ -222,18 +222,15 @@ static struct mem_ctl_info *find_mci_by_dev(struct device *dev)
*/ */
static int edac_mc_assert_error_check_and_clear(void) static int edac_mc_assert_error_check_and_clear(void)
{ {
int vreg; int old_state;
if(edac_op_state == EDAC_OPSTATE_POLL) if(edac_op_state == EDAC_OPSTATE_POLL)
return 1; return 1;
vreg = atomic_read(&edac_err_assert); old_state = edac_err_assert;
if(vreg) { edac_err_assert = 0;
atomic_set(&edac_err_assert, 0);
return 1;
}
return 0; return old_state;
} }
/* /*
......
...@@ -20,7 +20,7 @@ EXPORT_SYMBOL(edac_op_state); ...@@ -20,7 +20,7 @@ EXPORT_SYMBOL(edac_op_state);
atomic_t edac_handlers = ATOMIC_INIT(0); atomic_t edac_handlers = ATOMIC_INIT(0);
EXPORT_SYMBOL(edac_handlers); EXPORT_SYMBOL(edac_handlers);
atomic_t edac_err_assert = ATOMIC_INIT(0); int edac_err_assert = 0;
EXPORT_SYMBOL(edac_err_assert); EXPORT_SYMBOL(edac_err_assert);
inline int edac_handler_set(void) inline int edac_handler_set(void)
...@@ -37,6 +37,6 @@ EXPORT_SYMBOL(edac_handler_set); ...@@ -37,6 +37,6 @@ EXPORT_SYMBOL(edac_handler_set);
*/ */
inline void edac_atomic_assert_error(void) inline void edac_atomic_assert_error(void)
{ {
atomic_set(&edac_err_assert, 1); edac_err_assert++;
} }
EXPORT_SYMBOL(edac_atomic_assert_error); EXPORT_SYMBOL(edac_atomic_assert_error);
...@@ -20,8 +20,8 @@ ...@@ -20,8 +20,8 @@
#define EDAC_OPSTATE_INT 2 #define EDAC_OPSTATE_INT 2
extern int edac_op_state; extern int edac_op_state;
extern int edac_err_assert;
extern atomic_t edac_handlers; extern atomic_t edac_handlers;
extern atomic_t edac_err_assert;
extern int edac_handler_set(void); extern int edac_handler_set(void);
extern void edac_atomic_assert_error(void); extern void edac_atomic_assert_error(void);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment