diff options
Diffstat (limited to 'kernel/irq/manage.c')
| -rw-r--r-- | kernel/irq/manage.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index 2734eca59243..50da67672901 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c | |||
| @@ -80,7 +80,7 @@ int irq_can_set_affinity(unsigned int irq) | |||
| 80 | return 1; | 80 | return 1; |
| 81 | } | 81 | } |
| 82 | 82 | ||
| 83 | static void | 83 | void |
| 84 | irq_set_thread_affinity(struct irq_desc *desc, const struct cpumask *cpumask) | 84 | irq_set_thread_affinity(struct irq_desc *desc, const struct cpumask *cpumask) |
| 85 | { | 85 | { |
| 86 | struct irqaction *action = desc->action; | 86 | struct irqaction *action = desc->action; |
| @@ -109,17 +109,22 @@ int irq_set_affinity(unsigned int irq, const struct cpumask *cpumask) | |||
| 109 | spin_lock_irqsave(&desc->lock, flags); | 109 | spin_lock_irqsave(&desc->lock, flags); |
| 110 | 110 | ||
| 111 | #ifdef CONFIG_GENERIC_PENDING_IRQ | 111 | #ifdef CONFIG_GENERIC_PENDING_IRQ |
| 112 | if (desc->status & IRQ_MOVE_PCNTXT) | 112 | if (desc->status & IRQ_MOVE_PCNTXT) { |
| 113 | desc->chip->set_affinity(irq, cpumask); | 113 | if (!desc->chip->set_affinity(irq, cpumask)) { |
| 114 | cpumask_copy(desc->affinity, cpumask); | ||
| 115 | irq_set_thread_affinity(desc, cpumask); | ||
| 116 | } | ||
| 117 | } | ||
| 114 | else { | 118 | else { |
| 115 | desc->status |= IRQ_MOVE_PENDING; | 119 | desc->status |= IRQ_MOVE_PENDING; |
| 116 | cpumask_copy(desc->pending_mask, cpumask); | 120 | cpumask_copy(desc->pending_mask, cpumask); |
| 117 | } | 121 | } |
| 118 | #else | 122 | #else |
| 119 | cpumask_copy(desc->affinity, cpumask); | 123 | if (!desc->chip->set_affinity(irq, cpumask)) { |
| 120 | desc->chip->set_affinity(irq, cpumask); | 124 | cpumask_copy(desc->affinity, cpumask); |
| 125 | irq_set_thread_affinity(desc, cpumask); | ||
| 126 | } | ||
| 121 | #endif | 127 | #endif |
| 122 | irq_set_thread_affinity(desc, cpumask); | ||
| 123 | desc->status |= IRQ_AFFINITY_SET; | 128 | desc->status |= IRQ_AFFINITY_SET; |
| 124 | spin_unlock_irqrestore(&desc->lock, flags); | 129 | spin_unlock_irqrestore(&desc->lock, flags); |
| 125 | return 0; | 130 | return 0; |
| @@ -851,7 +856,7 @@ EXPORT_SYMBOL(free_irq); | |||
| 851 | * still called in hard interrupt context and has to check | 856 | * still called in hard interrupt context and has to check |
| 852 | * whether the interrupt originates from the device. If yes it | 857 | * whether the interrupt originates from the device. If yes it |
| 853 | * needs to disable the interrupt on the device and return | 858 | * needs to disable the interrupt on the device and return |
| 854 | * IRQ_THREAD_WAKE which will wake up the handler thread and run | 859 | * IRQ_WAKE_THREAD which will wake up the handler thread and run |
| 855 | * @thread_fn. This split handler design is necessary to support | 860 | * @thread_fn. This split handler design is necessary to support |
| 856 | * shared interrupts. | 861 | * shared interrupts. |
| 857 | * | 862 | * |
