Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 113145
b: refs/heads/master
c: f8376e9
h: refs/heads/master
i:
  113143: c01f83d
v: v3
  • Loading branch information
David S. Miller committed Sep 20, 2008
1 parent c94f7e6 commit 396d598
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 27 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f5f1085720c4799dd1437f78e28e40c8dd557bba
refs/heads/master: f8376e933c4e80663f6f66a5b5dd90390a0feba2
42 changes: 16 additions & 26 deletions trunk/arch/sparc/kernel/sun4d_irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,7 @@ static struct sun4d_timer_regs __iomem *sun4d_timers;
#define MAX_STATIC_ALLOC 4
extern struct irqaction static_irqaction[MAX_STATIC_ALLOC];
extern int static_irq_count;
#ifdef CONFIG_SMP
static unsigned char sbus_tid[32];
#endif

static struct irqaction *irq_action[NR_IRQS];
extern spinlock_t irq_action_lock;
Expand All @@ -81,9 +79,9 @@ static int sbus_to_pil[] = {
};

static int nsbi;
#ifdef CONFIG_SMP

/* Exported for sun4d_smp.c */
DEFINE_SPINLOCK(sun4d_imsk_lock);
#endif

int show_sun4d_interrupts(struct seq_file *p, void *v)
{
Expand Down Expand Up @@ -349,36 +347,28 @@ int sun4d_request_irq(unsigned int irq,

static void sun4d_disable_irq(unsigned int irq)
{
#ifdef CONFIG_SMP
int tid = sbus_tid[(irq >> 5) - 1];
unsigned long flags;
#endif

if (irq < NR_IRQS) return;
#ifdef CONFIG_SMP
if (irq < NR_IRQS)
return;

spin_lock_irqsave(&sun4d_imsk_lock, flags);
cc_set_imsk_other(tid, cc_get_imsk_other(tid) | (1 << sbus_to_pil[(irq >> 2) & 7]));
spin_unlock_irqrestore(&sun4d_imsk_lock, flags);
#else
cc_set_imsk(cc_get_imsk() | (1 << sbus_to_pil[(irq >> 2) & 7]));
#endif
}

static void sun4d_enable_irq(unsigned int irq)
{
#ifdef CONFIG_SMP
int tid = sbus_tid[(irq >> 5) - 1];
unsigned long flags;
#endif

if (irq < NR_IRQS) return;
#ifdef CONFIG_SMP
if (irq < NR_IRQS)
return;

spin_lock_irqsave(&sun4d_imsk_lock, flags);
cc_set_imsk_other(tid, cc_get_imsk_other(tid) & ~(1 << sbus_to_pil[(irq >> 2) & 7]));
spin_unlock_irqrestore(&sun4d_imsk_lock, flags);
#else
cc_set_imsk(cc_get_imsk() & ~(1 << sbus_to_pil[(irq >> 2) & 7]));
#endif
}

#ifdef CONFIG_SMP
Expand Down Expand Up @@ -557,6 +547,11 @@ static void __init sun4d_init_timers(irq_handler_t counter_fn)
void __init sun4d_init_sbi_irq(void)
{
struct device_node *dp;
int target_cpu = 0;

#ifdef CONFIG_SMP
target_cpu = boot_cpu_id;
#endif

nsbi = 0;
for_each_node_by_name(dp, "sbi")
Expand All @@ -571,14 +566,9 @@ void __init sun4d_init_sbi_irq(void)
int board = of_getintprop_default(dp, "board#", 0);
unsigned int mask;

#ifdef CONFIG_SMP
{
extern unsigned char boot_cpu_id;

set_sbi_tid(devid, boot_cpu_id << 3);
sbus_tid[board] = boot_cpu_id;
}
#endif
set_sbi_tid(devid, target_cpu << 3);
sbus_tid[board] = target_cpu;

/* Get rid of pending irqs from PROM */
mask = acquire_sbi(devid, 0xffffffff);
if (mask) {
Expand Down

0 comments on commit 396d598

Please sign in to comment.