Lines Matching refs:action
189 struct irqaction *action; in irq_set_thread_affinity() local
191 for_each_action_of_desc(desc, action) { in irq_set_thread_affinity()
192 if (action->thread) { in irq_set_thread_affinity()
193 set_bit(IRQTF_AFFINITY, &action->thread_flags); in irq_set_thread_affinity()
194 wake_up_process(action->thread); in irq_set_thread_affinity()
196 if (action->secondary && action->secondary->thread) { in irq_set_thread_affinity()
197 set_bit(IRQTF_AFFINITY, &action->secondary->thread_flags); in irq_set_thread_affinity()
198 wake_up_process(action->secondary->thread); in irq_set_thread_affinity()
897 if (!desc->action || irqflags & desc->action->flags & IRQF_SHARED) in can_request_irq()
1001 static void irq_thread_check_affinity(struct irq_desc *desc, struct irqaction *action) in irq_thread_check_affinity() argument
1006 if (!test_and_clear_bit(IRQTF_AFFINITY, &action->thread_flags)) in irq_thread_check_affinity()
1016 set_bit(IRQTF_AFFINITY, &action->thread_flags); in irq_thread_check_affinity()
1039 static inline void irq_thread_check_affinity(struct irq_desc *desc, struct irqaction *action) { } in irq_thread_check_affinity() argument
1043 struct irqaction *action) in irq_wait_for_interrupt() argument
1047 irq_thread_check_affinity(desc, action); in irq_wait_for_interrupt()
1052 &action->thread_flags)) { in irq_wait_for_interrupt()
1061 &action->thread_flags)) { in irq_wait_for_interrupt()
1075 struct irqaction *action) in irq_finalize_oneshot() argument
1078 action->handler == irq_forced_secondary_handler) in irq_finalize_oneshot()
1110 if (test_bit(IRQTF_RUNTHREAD, &action->thread_flags)) in irq_finalize_oneshot()
1113 desc->threads_oneshot &= ~action->thread_mask; in irq_finalize_oneshot()
1129 static irqreturn_t irq_thread_fn(struct irq_desc *desc, struct irqaction *action) in irq_thread_fn() argument
1131 irqreturn_t ret = action->thread_fn(action->irq, action->dev_id); in irq_thread_fn()
1136 irq_finalize_oneshot(desc, action); in irq_thread_fn()
1146 static irqreturn_t irq_forced_thread_fn(struct irq_desc *desc, struct irqaction *action) in irq_forced_thread_fn() argument
1153 ret = irq_thread_fn(desc, action); in irq_forced_thread_fn()
1170 struct irqaction *action; in irq_thread_dtor() local
1175 action = kthread_data(tsk); in irq_thread_dtor()
1178 tsk->comm, tsk->pid, action->irq); in irq_thread_dtor()
1181 desc = irq_to_desc(action->irq); in irq_thread_dtor()
1186 if (test_and_clear_bit(IRQTF_RUNTHREAD, &action->thread_flags)) in irq_thread_dtor()
1190 irq_finalize_oneshot(desc, action); in irq_thread_dtor()
1193 static void irq_wake_secondary(struct irq_desc *desc, struct irqaction *action) in irq_wake_secondary() argument
1195 struct irqaction *secondary = action->secondary; in irq_wake_secondary()
1208 struct irqaction *action) in irq_thread_set_ready() argument
1210 set_bit(IRQTF_READY, &action->thread_flags); in irq_thread_set_ready()
1219 struct irqaction *action) in wake_up_and_wait_for_irq_thread_ready() argument
1221 if (!action || !action->thread) in wake_up_and_wait_for_irq_thread_ready()
1224 wake_up_process(action->thread); in wake_up_and_wait_for_irq_thread_ready()
1226 test_bit(IRQTF_READY, &action->thread_flags)); in wake_up_and_wait_for_irq_thread_ready()
1235 struct irqaction *action = data; in irq_thread() local
1236 struct irq_desc *desc = irq_to_desc(action->irq); in irq_thread()
1238 struct irqaction *action); in irq_thread()
1240 irq_thread_set_ready(desc, action); in irq_thread()
1245 &action->thread_flags)) in irq_thread()
1253 while (!irq_wait_for_interrupt(desc, action)) { in irq_thread()
1256 action_ret = handler_fn(desc, action); in irq_thread()
1258 irq_wake_secondary(desc, action); in irq_thread()
1281 struct irqaction *action; in irq_wake_thread() local
1287 for_each_action_of_desc(desc, action) { in irq_wake_thread()
1288 if (action->dev_id == dev_id) { in irq_wake_thread()
1289 if (action->thread) in irq_wake_thread()
1290 __irq_wake_thread(desc, action); in irq_wake_thread()
1528 if (!desc->action) { in __setup_irq()
1544 old_ptr = &desc->action; in __setup_irq()
1780 if (!desc->action) in __setup_irq()
1811 struct irqaction *action, **action_ptr; in __free_irq() local
1824 action_ptr = &desc->action; in __free_irq()
1826 action = *action_ptr; in __free_irq()
1828 if (!action) { in __free_irq()
1836 if (action->dev_id == dev_id) in __free_irq()
1838 action_ptr = &action->next; in __free_irq()
1842 *action_ptr = action->next; in __free_irq()
1844 irq_pm_remove_action(desc, action); in __free_irq()
1847 if (!desc->action) { in __free_irq()
1876 unregister_handler_proc(irq, action); in __free_irq()
1894 if (action->flags & IRQF_SHARED) { in __free_irq()
1896 action->handler(irq, dev_id); in __free_irq()
1907 if (action->thread) { in __free_irq()
1908 kthread_stop_put(action->thread); in __free_irq()
1909 if (action->secondary && action->secondary->thread) in __free_irq()
1910 kthread_stop_put(action->secondary->thread); in __free_irq()
1914 if (!desc->action) { in __free_irq()
1936 kfree(action->secondary); in __free_irq()
1937 return action; in __free_irq()
1958 struct irqaction *action; in free_irq() local
1969 action = __free_irq(desc, dev_id); in free_irq()
1971 if (!action) in free_irq()
1974 devname = action->name; in free_irq()
1975 kfree(action); in free_irq()
1987 if (!WARN_ON(desc->action == NULL)) { in __cleanup_nmi()
1988 irq_pm_remove_action(desc, desc->action); in __cleanup_nmi()
1989 devname = desc->action->name; in __cleanup_nmi()
1990 unregister_handler_proc(irq, desc->action); in __cleanup_nmi()
1992 kfree(desc->action); in __cleanup_nmi()
1993 desc->action = NULL; in __cleanup_nmi()
2070 struct irqaction *action; in request_threaded_irq() local
2110 action = kzalloc(sizeof(struct irqaction), GFP_KERNEL); in request_threaded_irq()
2111 if (!action) in request_threaded_irq()
2114 action->handler = handler; in request_threaded_irq()
2115 action->thread_fn = thread_fn; in request_threaded_irq()
2116 action->flags = irqflags; in request_threaded_irq()
2117 action->name = devname; in request_threaded_irq()
2118 action->dev_id = dev_id; in request_threaded_irq()
2122 kfree(action); in request_threaded_irq()
2126 retval = __setup_irq(irq, desc, action); in request_threaded_irq()
2130 kfree(action->secondary); in request_threaded_irq()
2131 kfree(action); in request_threaded_irq()
2225 struct irqaction *action; in request_nmi() local
2251 action = kzalloc(sizeof(struct irqaction), GFP_KERNEL); in request_nmi()
2252 if (!action) in request_nmi()
2255 action->handler = handler; in request_nmi()
2256 action->flags = irqflags | IRQF_NO_THREAD | IRQF_NOBALANCING; in request_nmi()
2257 action->name = name; in request_nmi()
2258 action->dev_id = dev_id; in request_nmi()
2264 retval = __setup_irq(irq, desc, action); in request_nmi()
2282 kfree(action); in request_nmi()
2349 struct irqaction *action; in __free_percpu_irq() local
2357 action = desc->action; in __free_percpu_irq()
2358 if (!action || action->percpu_dev_id != dev_id) { in __free_percpu_irq()
2370 desc->action = NULL; in __free_percpu_irq()
2374 unregister_handler_proc(irq, action); in __free_percpu_irq()
2377 return action; in __free_percpu_irq()
2465 struct irqaction *action; in __request_percpu_irq() local
2480 action = kzalloc(sizeof(struct irqaction), GFP_KERNEL); in __request_percpu_irq()
2481 if (!action) in __request_percpu_irq()
2484 action->handler = handler; in __request_percpu_irq()
2485 action->flags = flags | IRQF_PERCPU | IRQF_NO_SUSPEND; in __request_percpu_irq()
2486 action->name = devname; in __request_percpu_irq()
2487 action->percpu_dev_id = dev_id; in __request_percpu_irq()
2491 kfree(action); in __request_percpu_irq()
2495 retval = __setup_irq(irq, desc, action); in __request_percpu_irq()
2499 kfree(action); in __request_percpu_irq()
2530 struct irqaction *action; in request_percpu_nmi() local
2549 action = kzalloc(sizeof(struct irqaction), GFP_KERNEL); in request_percpu_nmi()
2550 if (!action) in request_percpu_nmi()
2553 action->handler = handler; in request_percpu_nmi()
2554 action->flags = IRQF_PERCPU | IRQF_NO_SUSPEND | IRQF_NO_THREAD in request_percpu_nmi()
2556 action->name = name; in request_percpu_nmi()
2557 action->percpu_dev_id = dev_id; in request_percpu_nmi()
2563 retval = __setup_irq(irq, desc, action); in request_percpu_nmi()
2574 kfree(action); in request_percpu_nmi()