diff options
author | Yinghai Lu <yinghai@kernel.org> | 2009-04-27 20:59:21 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-04-28 06:21:16 -0400 |
commit | d5dedd4507d307eb3f35f21b6e16f336fdc0d82a (patch) | |
tree | 2c31b00395bde49ec4c5a415b081daaec44d3dab /arch/ia64 | |
parent | fcef5911c7ea89b80d5bfc727f402f37c9eefd57 (diff) |
irq: change ->set_affinity() to return status
according to Ingo, change set_affinity() in irq_chip should return int,
because that way we can handle failure cases in a much cleaner way, in
the genirq layer.
v2: fix two typos
[ Impact: extend API ]
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Suresh Siddha <suresh.b.siddha@intel.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: linux-arch@vger.kernel.org
LKML-Reference: <49F654E9.4070809@kernel.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/ia64')
-rw-r--r-- | arch/ia64/hp/sim/hpsim_irq.c | 3 | ||||
-rw-r--r-- | arch/ia64/kernel/iosapic.c | 10 | ||||
-rw-r--r-- | arch/ia64/kernel/msi_ia64.c | 16 | ||||
-rw-r--r-- | arch/ia64/sn/kernel/irq.c | 4 | ||||
-rw-r--r-- | arch/ia64/sn/kernel/msi_sn.c | 8 |
5 files changed, 26 insertions, 15 deletions
diff --git a/arch/ia64/hp/sim/hpsim_irq.c b/arch/ia64/hp/sim/hpsim_irq.c index cc0a3182db3c..acb5047ab573 100644 --- a/arch/ia64/hp/sim/hpsim_irq.c +++ b/arch/ia64/hp/sim/hpsim_irq.c | |||
@@ -21,9 +21,10 @@ hpsim_irq_noop (unsigned int irq) | |||
21 | { | 21 | { |
22 | } | 22 | } |
23 | 23 | ||
24 | static void | 24 | static int |
25 | hpsim_set_affinity_noop(unsigned int a, const struct cpumask *b) | 25 | hpsim_set_affinity_noop(unsigned int a, const struct cpumask *b) |
26 | { | 26 | { |
27 | return 0; | ||
27 | } | 28 | } |
28 | 29 | ||
29 | static struct hw_interrupt_type irq_type_hp_sim = { | 30 | static struct hw_interrupt_type irq_type_hp_sim = { |
diff --git a/arch/ia64/kernel/iosapic.c b/arch/ia64/kernel/iosapic.c index 166e0d839fa0..f92cef47bf86 100644 --- a/arch/ia64/kernel/iosapic.c +++ b/arch/ia64/kernel/iosapic.c | |||
@@ -329,7 +329,7 @@ unmask_irq (unsigned int irq) | |||
329 | } | 329 | } |
330 | 330 | ||
331 | 331 | ||
332 | static void | 332 | static int |
333 | iosapic_set_affinity(unsigned int irq, const struct cpumask *mask) | 333 | iosapic_set_affinity(unsigned int irq, const struct cpumask *mask) |
334 | { | 334 | { |
335 | #ifdef CONFIG_SMP | 335 | #ifdef CONFIG_SMP |
@@ -343,15 +343,15 @@ iosapic_set_affinity(unsigned int irq, const struct cpumask *mask) | |||
343 | 343 | ||
344 | cpu = cpumask_first_and(cpu_online_mask, mask); | 344 | cpu = cpumask_first_and(cpu_online_mask, mask); |
345 | if (cpu >= nr_cpu_ids) | 345 | if (cpu >= nr_cpu_ids) |
346 | return; | 346 | return -1; |
347 | 347 | ||
348 | if (irq_prepare_move(irq, cpu)) | 348 | if (irq_prepare_move(irq, cpu)) |
349 | return; | 349 | return -1; |
350 | 350 | ||
351 | dest = cpu_physical_id(cpu); | 351 | dest = cpu_physical_id(cpu); |
352 | 352 | ||
353 | if (!iosapic_intr_info[irq].count) | 353 | if (!iosapic_intr_info[irq].count) |
354 | return; /* not an IOSAPIC interrupt */ | 354 | return -1; /* not an IOSAPIC interrupt */ |
355 | 355 | ||
356 | set_irq_affinity_info(irq, dest, redir); | 356 | set_irq_affinity_info(irq, dest, redir); |
357 | 357 | ||
@@ -376,7 +376,9 @@ iosapic_set_affinity(unsigned int irq, const struct cpumask *mask) | |||
376 | iosapic_write(iosapic, IOSAPIC_RTE_HIGH(rte_index), high32); | 376 | iosapic_write(iosapic, IOSAPIC_RTE_HIGH(rte_index), high32); |
377 | iosapic_write(iosapic, IOSAPIC_RTE_LOW(rte_index), low32); | 377 | iosapic_write(iosapic, IOSAPIC_RTE_LOW(rte_index), low32); |
378 | } | 378 | } |
379 | |||
379 | #endif | 380 | #endif |
381 | return 0; | ||
380 | } | 382 | } |
381 | 383 | ||
382 | /* | 384 | /* |
diff --git a/arch/ia64/kernel/msi_ia64.c b/arch/ia64/kernel/msi_ia64.c index 2b15e233f7fe..0f8ade9331ba 100644 --- a/arch/ia64/kernel/msi_ia64.c +++ b/arch/ia64/kernel/msi_ia64.c | |||
@@ -12,7 +12,7 @@ | |||
12 | static struct irq_chip ia64_msi_chip; | 12 | static struct irq_chip ia64_msi_chip; |
13 | 13 | ||
14 | #ifdef CONFIG_SMP | 14 | #ifdef CONFIG_SMP |
15 | static void ia64_set_msi_irq_affinity(unsigned int irq, | 15 | static int ia64_set_msi_irq_affinity(unsigned int irq, |
16 | const cpumask_t *cpu_mask) | 16 | const cpumask_t *cpu_mask) |
17 | { | 17 | { |
18 | struct msi_msg msg; | 18 | struct msi_msg msg; |
@@ -20,10 +20,10 @@ static void ia64_set_msi_irq_affinity(unsigned int irq, | |||
20 | int cpu = first_cpu(*cpu_mask); | 20 | int cpu = first_cpu(*cpu_mask); |
21 | 21 | ||
22 | if (!cpu_online(cpu)) | 22 | if (!cpu_online(cpu)) |
23 | return; | 23 | return -1; |
24 | 24 | ||
25 | if (irq_prepare_move(irq, cpu)) | 25 | if (irq_prepare_move(irq, cpu)) |
26 | return; | 26 | return -1; |
27 | 27 | ||
28 | read_msi_msg(irq, &msg); | 28 | read_msi_msg(irq, &msg); |
29 | 29 | ||
@@ -39,6 +39,8 @@ static void ia64_set_msi_irq_affinity(unsigned int irq, | |||
39 | 39 | ||
40 | write_msi_msg(irq, &msg); | 40 | write_msi_msg(irq, &msg); |
41 | cpumask_copy(irq_desc[irq].affinity, cpumask_of(cpu)); | 41 | cpumask_copy(irq_desc[irq].affinity, cpumask_of(cpu)); |
42 | |||
43 | return 0; | ||
42 | } | 44 | } |
43 | #endif /* CONFIG_SMP */ | 45 | #endif /* CONFIG_SMP */ |
44 | 46 | ||
@@ -130,17 +132,17 @@ void arch_teardown_msi_irq(unsigned int irq) | |||
130 | 132 | ||
131 | #ifdef CONFIG_DMAR | 133 | #ifdef CONFIG_DMAR |
132 | #ifdef CONFIG_SMP | 134 | #ifdef CONFIG_SMP |
133 | static void dmar_msi_set_affinity(unsigned int irq, const struct cpumask *mask) | 135 | static int dmar_msi_set_affinity(unsigned int irq, const struct cpumask *mask) |
134 | { | 136 | { |
135 | struct irq_cfg *cfg = irq_cfg + irq; | 137 | struct irq_cfg *cfg = irq_cfg + irq; |
136 | struct msi_msg msg; | 138 | struct msi_msg msg; |
137 | int cpu = cpumask_first(mask); | 139 | int cpu = cpumask_first(mask); |
138 | 140 | ||
139 | if (!cpu_online(cpu)) | 141 | if (!cpu_online(cpu)) |
140 | return; | 142 | return -1; |
141 | 143 | ||
142 | if (irq_prepare_move(irq, cpu)) | 144 | if (irq_prepare_move(irq, cpu)) |
143 | return; | 145 | return -1; |
144 | 146 | ||
145 | dmar_msi_read(irq, &msg); | 147 | dmar_msi_read(irq, &msg); |
146 | 148 | ||
@@ -151,6 +153,8 @@ static void dmar_msi_set_affinity(unsigned int irq, const struct cpumask *mask) | |||
151 | 153 | ||
152 | dmar_msi_write(irq, &msg); | 154 | dmar_msi_write(irq, &msg); |
153 | cpumask_copy(irq_desc[irq].affinity, mask); | 155 | cpumask_copy(irq_desc[irq].affinity, mask); |
156 | |||
157 | return 0; | ||
154 | } | 158 | } |
155 | #endif /* CONFIG_SMP */ | 159 | #endif /* CONFIG_SMP */ |
156 | 160 | ||
diff --git a/arch/ia64/sn/kernel/irq.c b/arch/ia64/sn/kernel/irq.c index 66fd705e82c0..764f26abac05 100644 --- a/arch/ia64/sn/kernel/irq.c +++ b/arch/ia64/sn/kernel/irq.c | |||
@@ -227,7 +227,7 @@ finish_up: | |||
227 | return new_irq_info; | 227 | return new_irq_info; |
228 | } | 228 | } |
229 | 229 | ||
230 | static void sn_set_affinity_irq(unsigned int irq, const struct cpumask *mask) | 230 | static int sn_set_affinity_irq(unsigned int irq, const struct cpumask *mask) |
231 | { | 231 | { |
232 | struct sn_irq_info *sn_irq_info, *sn_irq_info_safe; | 232 | struct sn_irq_info *sn_irq_info, *sn_irq_info_safe; |
233 | nasid_t nasid; | 233 | nasid_t nasid; |
@@ -239,6 +239,8 @@ static void sn_set_affinity_irq(unsigned int irq, const struct cpumask *mask) | |||
239 | list_for_each_entry_safe(sn_irq_info, sn_irq_info_safe, | 239 | list_for_each_entry_safe(sn_irq_info, sn_irq_info_safe, |
240 | sn_irq_lh[irq], list) | 240 | sn_irq_lh[irq], list) |
241 | (void)sn_retarget_vector(sn_irq_info, nasid, slice); | 241 | (void)sn_retarget_vector(sn_irq_info, nasid, slice); |
242 | |||
243 | return 0; | ||
242 | } | 244 | } |
243 | 245 | ||
244 | #ifdef CONFIG_SMP | 246 | #ifdef CONFIG_SMP |
diff --git a/arch/ia64/sn/kernel/msi_sn.c b/arch/ia64/sn/kernel/msi_sn.c index 81e428943d73..fbbfb9701201 100644 --- a/arch/ia64/sn/kernel/msi_sn.c +++ b/arch/ia64/sn/kernel/msi_sn.c | |||
@@ -151,7 +151,7 @@ int sn_setup_msi_irq(struct pci_dev *pdev, struct msi_desc *entry) | |||
151 | } | 151 | } |
152 | 152 | ||
153 | #ifdef CONFIG_SMP | 153 | #ifdef CONFIG_SMP |
154 | static void sn_set_msi_irq_affinity(unsigned int irq, | 154 | static int sn_set_msi_irq_affinity(unsigned int irq, |
155 | const struct cpumask *cpu_mask) | 155 | const struct cpumask *cpu_mask) |
156 | { | 156 | { |
157 | struct msi_msg msg; | 157 | struct msi_msg msg; |
@@ -168,7 +168,7 @@ static void sn_set_msi_irq_affinity(unsigned int irq, | |||
168 | cpu = cpumask_first(cpu_mask); | 168 | cpu = cpumask_first(cpu_mask); |
169 | sn_irq_info = sn_msi_info[irq].sn_irq_info; | 169 | sn_irq_info = sn_msi_info[irq].sn_irq_info; |
170 | if (sn_irq_info == NULL || sn_irq_info->irq_int_bit >= 0) | 170 | if (sn_irq_info == NULL || sn_irq_info->irq_int_bit >= 0) |
171 | return; | 171 | return -1; |
172 | 172 | ||
173 | /* | 173 | /* |
174 | * Release XIO resources for the old MSI PCI address | 174 | * Release XIO resources for the old MSI PCI address |
@@ -189,7 +189,7 @@ static void sn_set_msi_irq_affinity(unsigned int irq, | |||
189 | new_irq_info = sn_retarget_vector(sn_irq_info, nasid, slice); | 189 | new_irq_info = sn_retarget_vector(sn_irq_info, nasid, slice); |
190 | sn_msi_info[irq].sn_irq_info = new_irq_info; | 190 | sn_msi_info[irq].sn_irq_info = new_irq_info; |
191 | if (new_irq_info == NULL) | 191 | if (new_irq_info == NULL) |
192 | return; | 192 | return -1; |
193 | 193 | ||
194 | /* | 194 | /* |
195 | * Map the xio address into bus space | 195 | * Map the xio address into bus space |
@@ -206,6 +206,8 @@ static void sn_set_msi_irq_affinity(unsigned int irq, | |||
206 | 206 | ||
207 | write_msi_msg(irq, &msg); | 207 | write_msi_msg(irq, &msg); |
208 | cpumask_copy(irq_desc[irq].affinity, cpu_mask); | 208 | cpumask_copy(irq_desc[irq].affinity, cpu_mask); |
209 | |||
210 | return 0; | ||
209 | } | 211 | } |
210 | #endif /* CONFIG_SMP */ | 212 | #endif /* CONFIG_SMP */ |
211 | 213 | ||