Lines Matching refs:work
55 static bool irq_work_claim(struct irq_work *work) in irq_work_claim() argument
59 oflags = atomic_fetch_or(IRQ_WORK_CLAIMED | CSD_TYPE_IRQ_WORK, &work->node.a_flags); in irq_work_claim()
78 static void __irq_work_queue_local(struct irq_work *work) in __irq_work_queue_local() argument
85 work_flags = atomic_read(&work->node.a_flags); in __irq_work_queue_local()
97 if (!llist_add(&work->node.llist, list)) in __irq_work_queue_local()
106 bool irq_work_queue(struct irq_work *work) in irq_work_queue() argument
109 if (!irq_work_claim(work)) in irq_work_queue()
114 __irq_work_queue_local(work); in irq_work_queue()
127 bool irq_work_queue_on(struct irq_work *work, int cpu) in irq_work_queue_on() argument
130 return irq_work_queue(work); in irq_work_queue_on()
137 if (!irq_work_claim(work)) in irq_work_queue_on()
140 kasan_record_aux_stack(work); in irq_work_queue_on()
153 !(atomic_read(&work->node.a_flags) & IRQ_WORK_HARD_IRQ)) { in irq_work_queue_on()
155 if (!llist_add(&work->node.llist, &per_cpu(lazy_list, cpu))) in irq_work_queue_on()
158 work = &per_cpu(irq_work_wakeup, cpu); in irq_work_queue_on()
159 if (!irq_work_claim(work)) in irq_work_queue_on()
163 __smp_call_single_queue(cpu, &work->node.llist); in irq_work_queue_on()
165 __irq_work_queue_local(work); in irq_work_queue_on()
193 struct irq_work *work = arg; in irq_work_single() local
201 flags = atomic_read(&work->node.a_flags); in irq_work_single()
203 atomic_set(&work->node.a_flags, flags); in irq_work_single()
211 work->func(work); in irq_work_single()
218 (void)atomic_cmpxchg(&work->node.a_flags, flags, flags & ~IRQ_WORK_BUSY); in irq_work_single()
220 if ((IS_ENABLED(CONFIG_PREEMPT_RT) && !irq_work_is_hard(work)) || in irq_work_single()
222 rcuwait_wake_up(&work->irqwait); in irq_work_single()
227 struct irq_work *work, *tmp; in irq_work_run_list() local
241 llist_for_each_entry_safe(work, tmp, llnode, node.llist) in irq_work_run_list()
242 irq_work_single(work); in irq_work_run_list()
276 void irq_work_sync(struct irq_work *work) in irq_work_sync() argument
281 if ((IS_ENABLED(CONFIG_PREEMPT_RT) && !irq_work_is_hard(work)) || in irq_work_sync()
283 rcuwait_wait_event(&work->irqwait, !irq_work_is_busy(work), in irq_work_sync()
288 while (irq_work_is_busy(work)) in irq_work_sync()