diff options
| -rw-r--r-- | include/linux/sched.h | 10 | ||||
| -rw-r--r-- | kernel/irq/manage.c | 19 |
2 files changed, 16 insertions, 13 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index 7d379a6bfd88..07f537a371ce 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
| @@ -1319,6 +1319,11 @@ struct task_struct { | |||
| 1319 | unsigned sched_reset_on_fork:1; | 1319 | unsigned sched_reset_on_fork:1; |
| 1320 | unsigned sched_contributes_to_load:1; | 1320 | unsigned sched_contributes_to_load:1; |
| 1321 | 1321 | ||
| 1322 | #ifdef CONFIG_GENERIC_HARDIRQS | ||
| 1323 | /* IRQ handler threads */ | ||
| 1324 | unsigned irq_thread:1; | ||
| 1325 | #endif | ||
| 1326 | |||
| 1322 | pid_t pid; | 1327 | pid_t pid; |
| 1323 | pid_t tgid; | 1328 | pid_t tgid; |
| 1324 | 1329 | ||
| @@ -1427,11 +1432,6 @@ struct task_struct { | |||
| 1427 | * mempolicy */ | 1432 | * mempolicy */ |
| 1428 | spinlock_t alloc_lock; | 1433 | spinlock_t alloc_lock; |
| 1429 | 1434 | ||
| 1430 | #ifdef CONFIG_GENERIC_HARDIRQS | ||
| 1431 | /* IRQ handler threads */ | ||
| 1432 | struct irqaction *irqaction; | ||
| 1433 | #endif | ||
| 1434 | |||
| 1435 | /* Protection of the PI data structures: */ | 1435 | /* Protection of the PI data structures: */ |
| 1436 | raw_spinlock_t pi_lock; | 1436 | raw_spinlock_t pi_lock; |
| 1437 | 1437 | ||
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index c0730ad8a117..0fa3ce998ecb 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c | |||
| @@ -780,7 +780,7 @@ static int irq_thread(void *data) | |||
| 780 | handler_fn = irq_thread_fn; | 780 | handler_fn = irq_thread_fn; |
| 781 | 781 | ||
| 782 | sched_setscheduler(current, SCHED_FIFO, ¶m); | 782 | sched_setscheduler(current, SCHED_FIFO, ¶m); |
| 783 | current->irqaction = action; | 783 | current->irq_thread = 1; |
| 784 | 784 | ||
| 785 | while (!irq_wait_for_interrupt(action)) { | 785 | while (!irq_wait_for_interrupt(action)) { |
| 786 | 786 | ||
| @@ -818,10 +818,10 @@ static int irq_thread(void *data) | |||
| 818 | irq_finalize_oneshot(desc, action, true); | 818 | irq_finalize_oneshot(desc, action, true); |
| 819 | 819 | ||
| 820 | /* | 820 | /* |
| 821 | * Clear irqaction. Otherwise exit_irq_thread() would make | 821 | * Clear irq_thread. Otherwise exit_irq_thread() would make |
| 822 | * fuzz about an active irq thread going into nirvana. | 822 | * fuzz about an active irq thread going into nirvana. |
| 823 | */ | 823 | */ |
| 824 | current->irqaction = NULL; | 824 | current->irq_thread = 0; |
| 825 | return 0; | 825 | return 0; |
| 826 | } | 826 | } |
| 827 | 827 | ||
| @@ -832,27 +832,30 @@ void exit_irq_thread(void) | |||
| 832 | { | 832 | { |
| 833 | struct task_struct *tsk = current; | 833 | struct task_struct *tsk = current; |
| 834 | struct irq_desc *desc; | 834 | struct irq_desc *desc; |
| 835 | struct irqaction *action; | ||
| 835 | 836 | ||
| 836 | if (!tsk->irqaction) | 837 | if (!tsk->irq_thread) |
| 837 | return; | 838 | return; |
| 838 | 839 | ||
| 840 | action = kthread_data(tsk); | ||
| 841 | |||
| 839 | printk(KERN_ERR | 842 | printk(KERN_ERR |
| 840 | "exiting task \"%s\" (%d) is an active IRQ thread (irq %d)\n", | 843 | "exiting task \"%s\" (%d) is an active IRQ thread (irq %d)\n", |
| 841 | tsk->comm ? tsk->comm : "", tsk->pid, tsk->irqaction->irq); | 844 | tsk->comm ? tsk->comm : "", tsk->pid, action->irq); |
| 842 | 845 | ||
| 843 | desc = irq_to_desc(tsk->irqaction->irq); | 846 | desc = irq_to_desc(action->irq); |
| 844 | 847 | ||
| 845 | /* | 848 | /* |
| 846 | * Prevent a stale desc->threads_oneshot. Must be called | 849 | * Prevent a stale desc->threads_oneshot. Must be called |
| 847 | * before setting the IRQTF_DIED flag. | 850 | * before setting the IRQTF_DIED flag. |
| 848 | */ | 851 | */ |
| 849 | irq_finalize_oneshot(desc, tsk->irqaction, true); | 852 | irq_finalize_oneshot(desc, action, true); |
| 850 | 853 | ||
| 851 | /* | 854 | /* |
| 852 | * Set the THREAD DIED flag to prevent further wakeups of the | 855 | * Set the THREAD DIED flag to prevent further wakeups of the |
| 853 | * soon to be gone threaded handler. | 856 | * soon to be gone threaded handler. |
| 854 | */ | 857 | */ |
| 855 | set_bit(IRQTF_DIED, &tsk->irqaction->flags); | 858 | set_bit(IRQTF_DIED, &action->flags); |
| 856 | } | 859 | } |
| 857 | 860 | ||
| 858 | static void irq_setup_forced_threading(struct irqaction *new) | 861 | static void irq_setup_forced_threading(struct irqaction *new) |
