static struct mcinfo_logical_cpu *g_physinfo;
static uint32_t ncpus;
-static DEFINE_SPINLOCK(mcelog_lock);
+static DEFINE_MUTEX(mcelog_lock);
static struct xen_mce_log xen_mcelog = {
.signature = XEN_MCE_LOG_SIGNATURE,
unsigned num;
int i, err;
- spin_lock(&mcelog_lock);
+ mutex_lock(&mcelog_lock);
num = xen_mcelog.next;
err = -EFAULT;
out:
- spin_unlock(&mcelog_lock);
+ mutex_unlock(&mcelog_lock);
return err ? err : buf - ubuf;
}
}
/* virq handler for machine check error info*/
-static irqreturn_t xen_mce_interrupt(int irq, void *dev_id)
+static void xen_mce_work_fn(struct work_struct *work)
{
int err;
- unsigned long tmp;
- spin_lock_irqsave(&mcelog_lock, tmp);
+ mutex_lock(&mcelog_lock);
/* urgent mc_info */
err = mc_queue_handle(XEN_MC_URGENT);
pr_err(XEN_MCELOG
"Failed to handle nonurgent mc_info queue.\n");
- spin_unlock_irqrestore(&mcelog_lock, tmp);
+ mutex_unlock(&mcelog_lock);
+}
+static DECLARE_WORK(xen_mce_work, xen_mce_work_fn);
+static irqreturn_t xen_mce_interrupt(int irq, void *dev_id)
+{
+ schedule_work(&xen_mce_work);
return IRQ_HANDLED;
}