Commit 4d899be5 authored by Tejun Heo's avatar Tejun Heo

x86/mce: don't use [delayed_]work_pending()

There's no need to test whether a (delayed) work item in pending
before queueing, flushing or cancelling it.  Most uses are unnecessary
and quite a few of them are buggy.

Remove unnecessary pending tests from x86/mce.  Only compile tested.

v2: Local var work removed from mce_schedule_work() as suggested by
    Borislav.
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
Acked-by: default avatarBorislav Petkov <bp@alien8.de>
Cc: Tony Luck <tony.luck@intel.com>
Cc: linux-edac@vger.kernel.org
parent ba0c96cd
...@@ -512,11 +512,8 @@ int mce_available(struct cpuinfo_x86 *c) ...@@ -512,11 +512,8 @@ int mce_available(struct cpuinfo_x86 *c)
static void mce_schedule_work(void) static void mce_schedule_work(void)
{ {
if (!mce_ring_empty()) { if (!mce_ring_empty())
struct work_struct *work = &__get_cpu_var(mce_work); schedule_work(&__get_cpu_var(mce_work));
if (!work_pending(work))
schedule_work(work);
}
} }
DEFINE_PER_CPU(struct irq_work, mce_irq_work); DEFINE_PER_CPU(struct irq_work, mce_irq_work);
...@@ -1351,12 +1348,7 @@ int mce_notify_irq(void) ...@@ -1351,12 +1348,7 @@ int mce_notify_irq(void)
/* wake processes polling /dev/mcelog */ /* wake processes polling /dev/mcelog */
wake_up_interruptible(&mce_chrdev_wait); wake_up_interruptible(&mce_chrdev_wait);
/* if (mce_helper[0])
* There is no risk of missing notifications because
* work_pending is always cleared before the function is
* executed.
*/
if (mce_helper[0] && !work_pending(&mce_trigger_work))
schedule_work(&mce_trigger_work); schedule_work(&mce_trigger_work);
if (__ratelimit(&ratelimit)) if (__ratelimit(&ratelimit))
......
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