@@ -10,6 +10,13 @@ struct mce_softirq_barrier {
atomic_t outgen;
};
+#define DEFINE_MCE_BARRIER(name) \
+ struct mce_softirq_barrier name = { \
+ .val = ATOMIC_INIT(0), \
+ .ingen = ATOMIC_INIT(0), \
+ .outgen = ATOMIC_INIT(0), \
+ }
+
/*
* Initialize a barrier. Just set it to 0.
*/
@@ -174,10 +174,6 @@ void mce_need_clearbank_register(mce_need_clearbank_t cbfunc)
mc_need_clearbank_scan = cbfunc;
}
-
-static struct mce_softirq_barrier mce_inside_bar, mce_severity_bar;
-static struct mce_softirq_barrier mce_trap_bar;
-
/*
* mce_logout_lock should only be used in the trap handler,
* while MCIP has not been cleared yet in the global status
@@ -452,6 +448,7 @@ static int mce_urgent_action(const struct cpu_user_regs *regs,
/* Shared #MC handler. */
void mcheck_cmn_handler(const struct cpu_user_regs *regs)
{
+ static DEFINE_MCE_BARRIER(mce_trap_bar);
static atomic_t severity_cpu = ATOMIC_INIT(-1);
struct mca_banks *bankmask = mca_allbanks;
struct mca_banks *clear_bank = __get_cpu_var(mce_clear_banks);
@@ -1699,6 +1696,8 @@ static int mce_delayed_action(mctelem_cookie_t mctc)
/* Softirq Handler for this MCE# processing */
static void mce_softirq(void)
{
+ static DEFINE_MCE_BARRIER(mce_inside_bar);
+ static DEFINE_MCE_BARRIER(mce_severity_bar);
static atomic_t severity_cpu;
int cpu = smp_processor_id();
unsigned int workcpu;
@@ -1766,9 +1765,6 @@ void mce_handler_init(void)
/* callback register, do we really need so many callback? */
/* mce handler data initialization */
- mce_barrier_init(&mce_inside_bar);
- mce_barrier_init(&mce_severity_bar);
- mce_barrier_init(&mce_trap_bar);
spin_lock_init(&mce_logout_lock);
open_softirq(MACHINE_CHECK_SOFTIRQ, mce_softirq);
}