aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms
diff options
context:
space:
mode:
authorMilton Miller <miltonm@bga.com>2011-03-21 04:12:13 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2011-03-29 19:44:15 -0400
commit943739fd59d3b77e1020ca788bc64439d679693f (patch)
tree899e617b48f4104d103e7ab35310e453cc3cc4aa /arch/powerpc/platforms
parent4f1fc48a73a49a60b3e03e6d8fb363d1b328bd4e (diff)
powerpc/xics: Use hwirq for xics domain irq number
To try to avoid future confusion, rename irq to hwirq when it refers to a xics domain number instead of a linux irq number. Signed-off-by: Milton Miller <miltonm@bga.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/platforms')
-rw-r--r--arch/powerpc/platforms/pseries/xics.c57
1 files changed, 29 insertions, 28 deletions
diff --git a/arch/powerpc/platforms/pseries/xics.c b/arch/powerpc/platforms/pseries/xics.c
index 9e7ff87a5950..ec8fe22047b7 100644
--- a/arch/powerpc/platforms/pseries/xics.c
+++ b/arch/powerpc/platforms/pseries/xics.c
@@ -204,33 +204,33 @@ static int get_irq_server(unsigned int virq, const struct cpumask *cpumask,
204 204
205static void xics_unmask_irq(struct irq_data *d) 205static void xics_unmask_irq(struct irq_data *d)
206{ 206{
207 unsigned int irq; 207 unsigned int hwirq;
208 int call_status; 208 int call_status;
209 int server; 209 int server;
210 210
211 pr_devel("xics: unmask virq %d\n", d->irq); 211 pr_devel("xics: unmask virq %d\n", d->irq);
212 212
213 irq = (unsigned int)irq_map[d->irq].hwirq; 213 hwirq = (unsigned int)irq_map[d->irq].hwirq;
214 pr_devel(" -> map to hwirq 0x%x\n", irq); 214 pr_devel(" -> map to hwirq 0x%x\n", hwirq);
215 if (irq == XICS_IPI || irq == XICS_IRQ_SPURIOUS) 215 if (hwirq == XICS_IPI || hwirq == XICS_IRQ_SPURIOUS)
216 return; 216 return;
217 217
218 server = get_irq_server(d->irq, d->affinity, 0); 218 server = get_irq_server(d->irq, d->affinity, 0);
219 219
220 call_status = rtas_call(ibm_set_xive, 3, 1, NULL, irq, server, 220 call_status = rtas_call(ibm_set_xive, 3, 1, NULL, hwirq, server,
221 DEFAULT_PRIORITY); 221 DEFAULT_PRIORITY);
222 if (call_status != 0) { 222 if (call_status != 0) {
223 printk(KERN_ERR 223 printk(KERN_ERR
224 "%s: ibm_set_xive irq %u server %x returned %d\n", 224 "%s: ibm_set_xive irq %u server %x returned %d\n",
225 __func__, irq, server, call_status); 225 __func__, hwirq, server, call_status);
226 return; 226 return;
227 } 227 }
228 228
229 /* Now unmask the interrupt (often a no-op) */ 229 /* Now unmask the interrupt (often a no-op) */
230 call_status = rtas_call(ibm_int_on, 1, 1, NULL, irq); 230 call_status = rtas_call(ibm_int_on, 1, 1, NULL, hwirq);
231 if (call_status != 0) { 231 if (call_status != 0) {
232 printk(KERN_ERR "%s: ibm_int_on irq=%u returned %d\n", 232 printk(KERN_ERR "%s: ibm_int_on irq=%u returned %d\n",
233 __func__, irq, call_status); 233 __func__, hwirq, call_status);
234 return; 234 return;
235 } 235 }
236} 236}
@@ -276,14 +276,14 @@ static void xics_mask_real_irq(unsigned int hwirq)
276 276
277static void xics_mask_irq(struct irq_data *d) 277static void xics_mask_irq(struct irq_data *d)
278{ 278{
279 unsigned int irq; 279 unsigned int hwirq;
280 280
281 pr_devel("xics: mask virq %d\n", d->irq); 281 pr_devel("xics: mask virq %d\n", d->irq);
282 282
283 irq = (unsigned int)irq_map[d->irq].hwirq; 283 hwirq = (unsigned int)irq_map[d->irq].hwirq;
284 if (irq == XICS_IPI || irq == XICS_IRQ_SPURIOUS) 284 if (hwirq == XICS_IPI || hwirq == XICS_IRQ_SPURIOUS)
285 return; 285 return;
286 xics_mask_real_irq(irq); 286 xics_mask_real_irq(hwirq);
287} 287}
288 288
289static void xics_mask_unknown_vec(unsigned int vec) 289static void xics_mask_unknown_vec(unsigned int vec)
@@ -373,37 +373,37 @@ static unsigned char pop_cppr(void)
373 373
374static void xics_eoi_direct(struct irq_data *d) 374static void xics_eoi_direct(struct irq_data *d)
375{ 375{
376 unsigned int irq = (unsigned int)irq_map[d->irq].hwirq; 376 unsigned int hwirq = (unsigned int)irq_map[d->irq].hwirq;
377 377
378 iosync(); 378 iosync();
379 direct_xirr_info_set((pop_cppr() << 24) | irq); 379 direct_xirr_info_set((pop_cppr() << 24) | hwirq);
380} 380}
381 381
382static void xics_eoi_lpar(struct irq_data *d) 382static void xics_eoi_lpar(struct irq_data *d)
383{ 383{
384 unsigned int irq = (unsigned int)irq_map[d->irq].hwirq; 384 unsigned int hwirq = (unsigned int)irq_map[d->irq].hwirq;
385 385
386 iosync(); 386 iosync();
387 lpar_xirr_info_set((pop_cppr() << 24) | irq); 387 lpar_xirr_info_set((pop_cppr() << 24) | hwirq);
388} 388}
389 389
390static int 390static int
391xics_set_affinity(struct irq_data *d, const struct cpumask *cpumask, bool force) 391xics_set_affinity(struct irq_data *d, const struct cpumask *cpumask, bool force)
392{ 392{
393 unsigned int irq; 393 unsigned int hwirq;
394 int status; 394 int status;
395 int xics_status[2]; 395 int xics_status[2];
396 int irq_server; 396 int irq_server;
397 397
398 irq = (unsigned int)irq_map[d->irq].hwirq; 398 hwirq = (unsigned int)irq_map[d->irq].hwirq;
399 if (irq == XICS_IPI || irq == XICS_IRQ_SPURIOUS) 399 if (hwirq == XICS_IPI || hwirq == XICS_IRQ_SPURIOUS)
400 return -1; 400 return -1;
401 401
402 status = rtas_call(ibm_get_xive, 1, 3, xics_status, irq); 402 status = rtas_call(ibm_get_xive, 1, 3, xics_status, hwirq);
403 403
404 if (status) { 404 if (status) {
405 printk(KERN_ERR "%s: ibm,get-xive irq=%u returns %d\n", 405 printk(KERN_ERR "%s: ibm,get-xive irq=%u returns %d\n",
406 __func__, irq, status); 406 __func__, hwirq, status);
407 return -1; 407 return -1;
408 } 408 }
409 409
@@ -418,11 +418,11 @@ xics_set_affinity(struct irq_data *d, const struct cpumask *cpumask, bool force)
418 } 418 }
419 419
420 status = rtas_call(ibm_set_xive, 3, 1, NULL, 420 status = rtas_call(ibm_set_xive, 3, 1, NULL,
421 irq, irq_server, xics_status[1]); 421 hwirq, irq_server, xics_status[1]);
422 422
423 if (status) { 423 if (status) {
424 printk(KERN_ERR "%s: ibm,set-xive irq=%u returns %d\n", 424 printk(KERN_ERR "%s: ibm,set-xive irq=%u returns %d\n",
425 __func__, irq, status); 425 __func__, hwirq, status);
426 return -1; 426 return -1;
427 } 427 }
428 428
@@ -874,7 +874,7 @@ void xics_kexec_teardown_cpu(int secondary)
874void xics_migrate_irqs_away(void) 874void xics_migrate_irqs_away(void)
875{ 875{
876 int cpu = smp_processor_id(), hw_cpu = hard_smp_processor_id(); 876 int cpu = smp_processor_id(), hw_cpu = hard_smp_processor_id();
877 unsigned int irq, virq; 877 int virq;
878 878
879 /* If we used to be the default server, move to the new "boot_cpuid" */ 879 /* If we used to be the default server, move to the new "boot_cpuid" */
880 if (hw_cpu == default_server) 880 if (hw_cpu == default_server)
@@ -892,6 +892,7 @@ void xics_migrate_irqs_away(void)
892 for_each_irq(virq) { 892 for_each_irq(virq) {
893 struct irq_desc *desc; 893 struct irq_desc *desc;
894 struct irq_chip *chip; 894 struct irq_chip *chip;
895 unsigned int hwirq;
895 int xics_status[2]; 896 int xics_status[2];
896 int status; 897 int status;
897 unsigned long flags; 898 unsigned long flags;
@@ -901,9 +902,9 @@ void xics_migrate_irqs_away(void)
901 continue; 902 continue;
902 if (irq_map[virq].host != xics_host) 903 if (irq_map[virq].host != xics_host)
903 continue; 904 continue;
904 irq = (unsigned int)irq_map[virq].hwirq; 905 hwirq = (unsigned int)irq_map[virq].hwirq;
905 /* We need to get IPIs still. */ 906 /* We need to get IPIs still. */
906 if (irq == XICS_IPI || irq == XICS_IRQ_SPURIOUS) 907 if (hwirq == XICS_IPI || hwirq == XICS_IRQ_SPURIOUS)
907 continue; 908 continue;
908 909
909 desc = irq_to_desc(virq); 910 desc = irq_to_desc(virq);
@@ -918,10 +919,10 @@ void xics_migrate_irqs_away(void)
918 919
919 raw_spin_lock_irqsave(&desc->lock, flags); 920 raw_spin_lock_irqsave(&desc->lock, flags);
920 921
921 status = rtas_call(ibm_get_xive, 1, 3, xics_status, irq); 922 status = rtas_call(ibm_get_xive, 1, 3, xics_status, hwirq);
922 if (status) { 923 if (status) {
923 printk(KERN_ERR "%s: ibm,get-xive irq=%u returns %d\n", 924 printk(KERN_ERR "%s: ibm,get-xive irq=%u returns %d\n",
924 __func__, irq, status); 925 __func__, hwirq, status);
925 goto unlock; 926 goto unlock;
926 } 927 }
927 928