kernel/smp.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/kernel/smp.c b/kernel/smp.c index f38a1e692259..13a8e75e1379 100644 --- a/kernel/smp.c +++ b/kernel/smp.c @@ -19,7 +19,6 @@ enum { CSD_FLAG_LOCK = 0x01, - CSD_FLAG_WAIT = 0x02, }; struct call_function_data { @@ -114,26 +113,24 @@ static void csd_lock_wait(struct call_single_data *csd) static void csd_lock(struct call_single_data *csd) { csd_lock_wait(csd); - csd->flags |= CSD_FLAG_LOCK; + csd->flags = CSD_FLAG_LOCK; /* * prevent CPU from reordering the above assignment * to ->flags with any subsequent assignments to other * fields of the specified call_single_data structure: */ - smp_mb(); + smp_wmb(); } static void csd_unlock(struct call_single_data *csd) { - WARN_ON((csd->flags & CSD_FLAG_WAIT) && !(csd->flags & CSD_FLAG_LOCK)); + WARN_ON(!(csd->flags & CSD_FLAG_LOCK)); /* * ensure we're all done before releasing data: */ - smp_mb(); - - csd->flags &= ~CSD_FLAG_LOCK; + smp_store_release(&csd->flags, 0); } static DEFINE_PER_CPU_SHARED_ALIGNED(struct call_single_data, csd_data); @@ -173,9 +170,6 @@ static int generic_exec_single(int cpu, struct call_single_data *csd, csd->func = func; csd->info = info; - if (wait) - csd->flags |= CSD_FLAG_WAIT; - /* * The list addition should be visible before sending the IPI * handler locks the list to pull the entry off it because of