diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2010-09-27 08:45:41 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2010-10-04 06:43:46 -0400 |
commit | c96b3b3c448592a0b87ef20306deb8b1fb4878c7 (patch) | |
tree | 744c6879a585b9ab07ed51315930f8a673c09aed /kernel/irq | |
parent | 37e12df709f09eac17314d79a52190ac46746e33 (diff) |
genirq: Provide compat handling for chip->set_affinity()
Wrap the old chip function set_affinity() until the migration is
complete and the old chip functions are removed.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
LKML-Reference: <20100927121842.732894108@linutronix.de>
Reviewed-by: H. Peter Anvin <hpa@zytor.com>
Reviewed-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/irq')
-rw-r--r-- | kernel/irq/chip.c | 8 | ||||
-rw-r--r-- | kernel/irq/manage.c | 11 | ||||
-rw-r--r-- | kernel/irq/migration.c | 6 | ||||
-rw-r--r-- | kernel/irq/proc.c | 2 |
4 files changed, 19 insertions, 8 deletions
diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c index cce85f0734b0..df51792d9fd3 100644 --- a/kernel/irq/chip.c +++ b/kernel/irq/chip.c | |||
@@ -370,6 +370,12 @@ static unsigned int compat_irq_startup(struct irq_data *data) | |||
370 | return data->chip->startup(data->irq); | 370 | return data->chip->startup(data->irq); |
371 | } | 371 | } |
372 | 372 | ||
373 | static int compat_irq_set_affinity(struct irq_data *data, | ||
374 | const struct cpumask *dest, bool force) | ||
375 | { | ||
376 | return data->chip->set_affinity(data->irq, dest); | ||
377 | } | ||
378 | |||
373 | static void compat_bus_lock(struct irq_data *data) | 379 | static void compat_bus_lock(struct irq_data *data) |
374 | { | 380 | { |
375 | data->chip->bus_lock(data->irq); | 381 | data->chip->bus_lock(data->irq); |
@@ -436,6 +442,8 @@ void irq_chip_set_defaults(struct irq_chip *chip) | |||
436 | chip->irq_mask_ack = compat_irq_mask_ack; | 442 | chip->irq_mask_ack = compat_irq_mask_ack; |
437 | if (chip->eoi) | 443 | if (chip->eoi) |
438 | chip->irq_eoi = compat_irq_eoi; | 444 | chip->irq_eoi = compat_irq_eoi; |
445 | if (chip->set_affinity) | ||
446 | chip->irq_set_affinity = compat_irq_set_affinity; | ||
439 | } | 447 | } |
440 | 448 | ||
441 | static inline void mask_ack_irq(struct irq_desc *desc) | 449 | static inline void mask_ack_irq(struct irq_desc *desc) |
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index 31d7678e0269..305a60ff756b 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c | |||
@@ -74,7 +74,7 @@ int irq_can_set_affinity(unsigned int irq) | |||
74 | struct irq_desc *desc = irq_to_desc(irq); | 74 | struct irq_desc *desc = irq_to_desc(irq); |
75 | 75 | ||
76 | if (CHECK_IRQ_PER_CPU(desc->status) || !desc->irq_data.chip || | 76 | if (CHECK_IRQ_PER_CPU(desc->status) || !desc->irq_data.chip || |
77 | !desc->irq_data.chip->set_affinity) | 77 | !desc->irq_data.chip->irq_set_affinity) |
78 | return 0; | 78 | return 0; |
79 | 79 | ||
80 | return 1; | 80 | return 1; |
@@ -109,16 +109,17 @@ void irq_set_thread_affinity(struct irq_desc *desc) | |||
109 | int irq_set_affinity(unsigned int irq, const struct cpumask *cpumask) | 109 | int irq_set_affinity(unsigned int irq, const struct cpumask *cpumask) |
110 | { | 110 | { |
111 | struct irq_desc *desc = irq_to_desc(irq); | 111 | struct irq_desc *desc = irq_to_desc(irq); |
112 | struct irq_chip *chip = desc->irq_data.chip; | ||
112 | unsigned long flags; | 113 | unsigned long flags; |
113 | 114 | ||
114 | if (!desc->irq_data.chip->set_affinity) | 115 | if (!chip->irq_set_affinity) |
115 | return -EINVAL; | 116 | return -EINVAL; |
116 | 117 | ||
117 | raw_spin_lock_irqsave(&desc->lock, flags); | 118 | raw_spin_lock_irqsave(&desc->lock, flags); |
118 | 119 | ||
119 | #ifdef CONFIG_GENERIC_PENDING_IRQ | 120 | #ifdef CONFIG_GENERIC_PENDING_IRQ |
120 | if (desc->status & IRQ_MOVE_PCNTXT) { | 121 | if (desc->status & IRQ_MOVE_PCNTXT) { |
121 | if (!desc->irq_data.chip->set_affinity(irq, cpumask)) { | 122 | if (!chip->irq_set_affinity(&desc->irq_data, cpumask, false)) { |
122 | cpumask_copy(desc->irq_data.affinity, cpumask); | 123 | cpumask_copy(desc->irq_data.affinity, cpumask); |
123 | irq_set_thread_affinity(desc); | 124 | irq_set_thread_affinity(desc); |
124 | } | 125 | } |
@@ -128,7 +129,7 @@ int irq_set_affinity(unsigned int irq, const struct cpumask *cpumask) | |||
128 | cpumask_copy(desc->pending_mask, cpumask); | 129 | cpumask_copy(desc->pending_mask, cpumask); |
129 | } | 130 | } |
130 | #else | 131 | #else |
131 | if (!desc->irq_data.chip->set_affinity(irq, cpumask)) { | 132 | if (!chip->irq_set_affinity(&desc->irq_data, cpumask, false)) { |
132 | cpumask_copy(desc->irq_data.affinity, cpumask); | 133 | cpumask_copy(desc->irq_data.affinity, cpumask); |
133 | irq_set_thread_affinity(desc); | 134 | irq_set_thread_affinity(desc); |
134 | } | 135 | } |
@@ -177,7 +178,7 @@ static int setup_affinity(unsigned int irq, struct irq_desc *desc) | |||
177 | 178 | ||
178 | cpumask_and(desc->irq_data.affinity, cpu_online_mask, irq_default_affinity); | 179 | cpumask_and(desc->irq_data.affinity, cpu_online_mask, irq_default_affinity); |
179 | set_affinity: | 180 | set_affinity: |
180 | desc->irq_data.chip->set_affinity(irq, desc->irq_data.affinity); | 181 | desc->irq_data.chip->irq_set_affinity(&desc->irq_data, desc->irq_data.affinity, false); |
181 | 182 | ||
182 | return 0; | 183 | return 0; |
183 | } | 184 | } |
diff --git a/kernel/irq/migration.c b/kernel/irq/migration.c index 7888e5d5575a..1d2541940480 100644 --- a/kernel/irq/migration.c +++ b/kernel/irq/migration.c | |||
@@ -7,6 +7,7 @@ | |||
7 | void move_masked_irq(int irq) | 7 | void move_masked_irq(int irq) |
8 | { | 8 | { |
9 | struct irq_desc *desc = irq_to_desc(irq); | 9 | struct irq_desc *desc = irq_to_desc(irq); |
10 | struct irq_chip *chip = desc->irq_data.chip; | ||
10 | 11 | ||
11 | if (likely(!(desc->status & IRQ_MOVE_PENDING))) | 12 | if (likely(!(desc->status & IRQ_MOVE_PENDING))) |
12 | return; | 13 | return; |
@@ -24,7 +25,7 @@ void move_masked_irq(int irq) | |||
24 | if (unlikely(cpumask_empty(desc->pending_mask))) | 25 | if (unlikely(cpumask_empty(desc->pending_mask))) |
25 | return; | 26 | return; |
26 | 27 | ||
27 | if (!desc->irq_data.chip->set_affinity) | 28 | if (!chip->irq_set_affinity) |
28 | return; | 29 | return; |
29 | 30 | ||
30 | assert_raw_spin_locked(&desc->lock); | 31 | assert_raw_spin_locked(&desc->lock); |
@@ -43,7 +44,8 @@ void move_masked_irq(int irq) | |||
43 | */ | 44 | */ |
44 | if (likely(cpumask_any_and(desc->pending_mask, cpu_online_mask) | 45 | if (likely(cpumask_any_and(desc->pending_mask, cpu_online_mask) |
45 | < nr_cpu_ids)) | 46 | < nr_cpu_ids)) |
46 | if (!desc->irq_data.chip->set_affinity(irq, desc->pending_mask)) { | 47 | if (!chip->irq_set_affinity(&desc->irq_data, |
48 | desc->pending_mask, false)) { | ||
47 | cpumask_copy(desc->irq_data.affinity, desc->pending_mask); | 49 | cpumask_copy(desc->irq_data.affinity, desc->pending_mask); |
48 | irq_set_thread_affinity(desc); | 50 | irq_set_thread_affinity(desc); |
49 | } | 51 | } |
diff --git a/kernel/irq/proc.c b/kernel/irq/proc.c index 9b0da94b5b2b..d9fddf918b41 100644 --- a/kernel/irq/proc.c +++ b/kernel/irq/proc.c | |||
@@ -65,7 +65,7 @@ static ssize_t irq_affinity_proc_write(struct file *file, | |||
65 | cpumask_var_t new_value; | 65 | cpumask_var_t new_value; |
66 | int err; | 66 | int err; |
67 | 67 | ||
68 | if (!irq_to_desc(irq)->irq_data.chip->set_affinity || no_irq_affinity || | 68 | if (!irq_to_desc(irq)->irq_data.chip->irq_set_affinity || no_irq_affinity || |
69 | irq_balancing_disabled(irq)) | 69 | irq_balancing_disabled(irq)) |
70 | return -EIO; | 70 | return -EIO; |
71 | 71 | ||