Commit b5bda626 authored by Santosh Sivaraj's avatar Santosh Sivaraj Committed by Michael Ellerman

powerpc/mce: Schedule work from irq_work

schedule_work() cannot be called from MCE exception context as MCE can
interrupt even in interrupt disabled context.

Fixes: 733e4a4c ("powerpc/mce: hookup memory_failure for UE errors")
Cc: stable@vger.kernel.org # v4.15+
Reviewed-by: default avatarMahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
Reviewed-by: default avatarNicholas Piggin <npiggin@gmail.com>
Acked-by: default avatarBalbir Singh <bsingharora@gmail.com>
Signed-off-by: default avatarSantosh Sivaraj <santosh@fossix.org>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20190820081352.8641-2-santosh@fossix.org
parent ccfb5bd7
...@@ -33,6 +33,7 @@ static DEFINE_PER_CPU(struct machine_check_event[MAX_MC_EVT], ...@@ -33,6 +33,7 @@ static DEFINE_PER_CPU(struct machine_check_event[MAX_MC_EVT],
mce_ue_event_queue); mce_ue_event_queue);
static void machine_check_process_queued_event(struct irq_work *work); static void machine_check_process_queued_event(struct irq_work *work);
static void machine_check_ue_irq_work(struct irq_work *work);
void machine_check_ue_event(struct machine_check_event *evt); void machine_check_ue_event(struct machine_check_event *evt);
static void machine_process_ue_event(struct work_struct *work); static void machine_process_ue_event(struct work_struct *work);
...@@ -40,6 +41,10 @@ static struct irq_work mce_event_process_work = { ...@@ -40,6 +41,10 @@ static struct irq_work mce_event_process_work = {
.func = machine_check_process_queued_event, .func = machine_check_process_queued_event,
}; };
static struct irq_work mce_ue_event_irq_work = {
.func = machine_check_ue_irq_work,
};
DECLARE_WORK(mce_ue_event_work, machine_process_ue_event); DECLARE_WORK(mce_ue_event_work, machine_process_ue_event);
static void mce_set_error_info(struct machine_check_event *mce, static void mce_set_error_info(struct machine_check_event *mce,
...@@ -199,6 +204,10 @@ void release_mce_event(void) ...@@ -199,6 +204,10 @@ void release_mce_event(void)
get_mce_event(NULL, true); get_mce_event(NULL, true);
} }
static void machine_check_ue_irq_work(struct irq_work *work)
{
schedule_work(&mce_ue_event_work);
}
/* /*
* Queue up the MCE event which then can be handled later. * Queue up the MCE event which then can be handled later.
...@@ -216,7 +225,7 @@ void machine_check_ue_event(struct machine_check_event *evt) ...@@ -216,7 +225,7 @@ void machine_check_ue_event(struct machine_check_event *evt)
memcpy(this_cpu_ptr(&mce_ue_event_queue[index]), evt, sizeof(*evt)); memcpy(this_cpu_ptr(&mce_ue_event_queue[index]), evt, sizeof(*evt));
/* Queue work to process this event later. */ /* Queue work to process this event later. */
schedule_work(&mce_ue_event_work); irq_work_queue(&mce_ue_event_irq_work);
} }
/* /*
......
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