aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc/kernel/sun4d_irq.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-09-14 01:05:25 -0400
committerDavid S. Miller <davem@davemloft.net>2008-09-20 00:17:56 -0400
commitf8376e933c4e80663f6f66a5b5dd90390a0feba2 (patch)
tree02f08515f29f71be67ca4ddb82b8411ea957ff26 /arch/sparc/kernel/sun4d_irq.c
parentf5f1085720c4799dd1437f78e28e40c8dd557bba (diff)
sparc32: Remove some SMP ifdefs in sun4d_irq.c
Always do the sbus_tid[] handling. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/kernel/sun4d_irq.c')
-rw-r--r--arch/sparc/kernel/sun4d_irq.c42
1 files changed, 16 insertions, 26 deletions
diff --git a/arch/sparc/kernel/sun4d_irq.c b/arch/sparc/kernel/sun4d_irq.c
index 4156bf6657fb..6e3bf6eee543 100644
--- a/arch/sparc/kernel/sun4d_irq.c
+++ b/arch/sparc/kernel/sun4d_irq.c
@@ -60,9 +60,7 @@ static struct sun4d_timer_regs __iomem *sun4d_timers;
60#define MAX_STATIC_ALLOC 4 60#define MAX_STATIC_ALLOC 4
61extern struct irqaction static_irqaction[MAX_STATIC_ALLOC]; 61extern struct irqaction static_irqaction[MAX_STATIC_ALLOC];
62extern int static_irq_count; 62extern int static_irq_count;
63#ifdef CONFIG_SMP
64static unsigned char sbus_tid[32]; 63static unsigned char sbus_tid[32];
65#endif
66 64
67static struct irqaction *irq_action[NR_IRQS]; 65static struct irqaction *irq_action[NR_IRQS];
68extern spinlock_t irq_action_lock; 66extern spinlock_t irq_action_lock;
@@ -81,9 +79,9 @@ static int sbus_to_pil[] = {
81}; 79};
82 80
83static int nsbi; 81static int nsbi;
84#ifdef CONFIG_SMP 82
83/* Exported for sun4d_smp.c */
85DEFINE_SPINLOCK(sun4d_imsk_lock); 84DEFINE_SPINLOCK(sun4d_imsk_lock);
86#endif
87 85
88int show_sun4d_interrupts(struct seq_file *p, void *v) 86int show_sun4d_interrupts(struct seq_file *p, void *v)
89{ 87{
@@ -349,36 +347,28 @@ out:
349 347
350static void sun4d_disable_irq(unsigned int irq) 348static void sun4d_disable_irq(unsigned int irq)
351{ 349{
352#ifdef CONFIG_SMP
353 int tid = sbus_tid[(irq >> 5) - 1]; 350 int tid = sbus_tid[(irq >> 5) - 1];
354 unsigned long flags; 351 unsigned long flags;
355#endif
356 352
357 if (irq < NR_IRQS) return; 353 if (irq < NR_IRQS)
358#ifdef CONFIG_SMP 354 return;
355
359 spin_lock_irqsave(&sun4d_imsk_lock, flags); 356 spin_lock_irqsave(&sun4d_imsk_lock, flags);
360 cc_set_imsk_other(tid, cc_get_imsk_other(tid) | (1 << sbus_to_pil[(irq >> 2) & 7])); 357 cc_set_imsk_other(tid, cc_get_imsk_other(tid) | (1 << sbus_to_pil[(irq >> 2) & 7]));
361 spin_unlock_irqrestore(&sun4d_imsk_lock, flags); 358 spin_unlock_irqrestore(&sun4d_imsk_lock, flags);
362#else
363 cc_set_imsk(cc_get_imsk() | (1 << sbus_to_pil[(irq >> 2) & 7]));
364#endif
365} 359}
366 360
367static void sun4d_enable_irq(unsigned int irq) 361static void sun4d_enable_irq(unsigned int irq)
368{ 362{
369#ifdef CONFIG_SMP
370 int tid = sbus_tid[(irq >> 5) - 1]; 363 int tid = sbus_tid[(irq >> 5) - 1];
371 unsigned long flags; 364 unsigned long flags;
372#endif
373 365
374 if (irq < NR_IRQS) return; 366 if (irq < NR_IRQS)
375#ifdef CONFIG_SMP 367 return;
368
376 spin_lock_irqsave(&sun4d_imsk_lock, flags); 369 spin_lock_irqsave(&sun4d_imsk_lock, flags);
377 cc_set_imsk_other(tid, cc_get_imsk_other(tid) & ~(1 << sbus_to_pil[(irq >> 2) & 7])); 370 cc_set_imsk_other(tid, cc_get_imsk_other(tid) & ~(1 << sbus_to_pil[(irq >> 2) & 7]));
378 spin_unlock_irqrestore(&sun4d_imsk_lock, flags); 371 spin_unlock_irqrestore(&sun4d_imsk_lock, flags);
379#else
380 cc_set_imsk(cc_get_imsk() & ~(1 << sbus_to_pil[(irq >> 2) & 7]));
381#endif
382} 372}
383 373
384#ifdef CONFIG_SMP 374#ifdef CONFIG_SMP
@@ -557,6 +547,11 @@ static void __init sun4d_init_timers(irq_handler_t counter_fn)
557void __init sun4d_init_sbi_irq(void) 547void __init sun4d_init_sbi_irq(void)
558{ 548{
559 struct device_node *dp; 549 struct device_node *dp;
550 int target_cpu = 0;
551
552#ifdef CONFIG_SMP
553 target_cpu = boot_cpu_id;
554#endif
560 555
561 nsbi = 0; 556 nsbi = 0;
562 for_each_node_by_name(dp, "sbi") 557 for_each_node_by_name(dp, "sbi")
@@ -571,14 +566,9 @@ void __init sun4d_init_sbi_irq(void)
571 int board = of_getintprop_default(dp, "board#", 0); 566 int board = of_getintprop_default(dp, "board#", 0);
572 unsigned int mask; 567 unsigned int mask;
573 568
574#ifdef CONFIG_SMP 569 set_sbi_tid(devid, target_cpu << 3);
575 { 570 sbus_tid[board] = target_cpu;
576 extern unsigned char boot_cpu_id; 571
577
578 set_sbi_tid(devid, boot_cpu_id << 3);
579 sbus_tid[board] = boot_cpu_id;
580 }
581#endif
582 /* Get rid of pending irqs from PROM */ 572 /* Get rid of pending irqs from PROM */
583 mask = acquire_sbi(devid, 0xffffffff); 573 mask = acquire_sbi(devid, 0xffffffff);
584 if (mask) { 574 if (mask) {