summaryrefslogtreecommitdiff
path: root/kernel/irq/manage.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/irq/manage.c')
-rw-r--r--kernel/irq/manage.c24
1 files changed, 7 insertions, 17 deletions
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index 7f4041357d2f..b2736d7d863b 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -261,7 +261,7 @@ int irq_set_affinity_locked(struct irq_data *data, const struct cpumask *mask,
kref_get(&desc->affinity_notify->kref);
#ifdef CONFIG_PREEMPT_RT_BASE
- swork_queue(&desc->affinity_notify->swork);
+ kthread_schedule_work(&desc->affinity_notify->work);
#else
schedule_work(&desc->affinity_notify->work);
#endif
@@ -326,21 +326,11 @@ out:
}
#ifdef CONFIG_PREEMPT_RT_BASE
-static void init_helper_thread(void)
-{
- static int init_sworker_once;
-
- if (init_sworker_once)
- return;
- if (WARN_ON(swork_get()))
- return;
- init_sworker_once = 1;
-}
-static void irq_affinity_notify(struct swork_event *swork)
+static void irq_affinity_notify(struct kthread_work *work)
{
struct irq_affinity_notify *notify =
- container_of(swork, struct irq_affinity_notify, swork);
+ container_of(work, struct irq_affinity_notify, work);
_irq_affinity_notify(notify);
}
@@ -383,8 +373,7 @@ irq_set_affinity_notifier(unsigned int irq, struct irq_affinity_notify *notify)
notify->irq = irq;
kref_init(&notify->kref);
#ifdef CONFIG_PREEMPT_RT_BASE
- INIT_SWORK(&notify->swork, irq_affinity_notify);
- init_helper_thread();
+ kthread_init_work(&notify->work, irq_affinity_notify);
#else
INIT_WORK(&notify->work, irq_affinity_notify);
#endif
@@ -396,8 +385,9 @@ irq_set_affinity_notifier(unsigned int irq, struct irq_affinity_notify *notify)
raw_spin_unlock_irqrestore(&desc->lock, flags);
if (old_notify) {
-#ifndef CONFIG_PREEMPT_RT_BASE
- /* Need to address this for PREEMPT_RT */
+#ifdef CONFIG_PREEMPT_RT_BASE
+ kthread_cancel_work_sync(&notify->work);
+#else
cancel_work_sync(&old_notify->work);
#endif
kref_put(&old_notify->kref, old_notify->release);