Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 243517
b: refs/heads/master
c: 943739f
h: refs/heads/master
i:
  243515: d278f16
v: v3
  • Loading branch information
Milton Miller authored and Benjamin Herrenschmidt committed Mar 29, 2011
1 parent 6663e3a commit ce0a502
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 29 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: 4f1fc48a73a49a60b3e03e6d8fb363d1b328bd4e
refs/heads/master: 943739fd59d3b77e1020ca788bc64439d679693f
57 changes: 29 additions & 28 deletions trunk/arch/powerpc/platforms/pseries/xics.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,33 +204,33 @@ static int get_irq_server(unsigned int virq, const struct cpumask *cpumask,

static void xics_unmask_irq(struct irq_data *d)
{
unsigned int irq;
unsigned int hwirq;
int call_status;
int server;

pr_devel("xics: unmask virq %d\n", d->irq);

irq = (unsigned int)irq_map[d->irq].hwirq;
pr_devel(" -> map to hwirq 0x%x\n", irq);
if (irq == XICS_IPI || irq == XICS_IRQ_SPURIOUS)
hwirq = (unsigned int)irq_map[d->irq].hwirq;
pr_devel(" -> map to hwirq 0x%x\n", hwirq);
if (hwirq == XICS_IPI || hwirq == XICS_IRQ_SPURIOUS)
return;

server = get_irq_server(d->irq, d->affinity, 0);

call_status = rtas_call(ibm_set_xive, 3, 1, NULL, irq, server,
call_status = rtas_call(ibm_set_xive, 3, 1, NULL, hwirq, server,
DEFAULT_PRIORITY);
if (call_status != 0) {
printk(KERN_ERR
"%s: ibm_set_xive irq %u server %x returned %d\n",
__func__, irq, server, call_status);
__func__, hwirq, server, call_status);
return;
}

/* Now unmask the interrupt (often a no-op) */
call_status = rtas_call(ibm_int_on, 1, 1, NULL, irq);
call_status = rtas_call(ibm_int_on, 1, 1, NULL, hwirq);
if (call_status != 0) {
printk(KERN_ERR "%s: ibm_int_on irq=%u returned %d\n",
__func__, irq, call_status);
__func__, hwirq, call_status);
return;
}
}
Expand Down Expand Up @@ -276,14 +276,14 @@ static void xics_mask_real_irq(unsigned int hwirq)

static void xics_mask_irq(struct irq_data *d)
{
unsigned int irq;
unsigned int hwirq;

pr_devel("xics: mask virq %d\n", d->irq);

irq = (unsigned int)irq_map[d->irq].hwirq;
if (irq == XICS_IPI || irq == XICS_IRQ_SPURIOUS)
hwirq = (unsigned int)irq_map[d->irq].hwirq;
if (hwirq == XICS_IPI || hwirq == XICS_IRQ_SPURIOUS)
return;
xics_mask_real_irq(irq);
xics_mask_real_irq(hwirq);
}

static void xics_mask_unknown_vec(unsigned int vec)
Expand Down Expand Up @@ -373,37 +373,37 @@ static unsigned char pop_cppr(void)

static void xics_eoi_direct(struct irq_data *d)
{
unsigned int irq = (unsigned int)irq_map[d->irq].hwirq;
unsigned int hwirq = (unsigned int)irq_map[d->irq].hwirq;

iosync();
direct_xirr_info_set((pop_cppr() << 24) | irq);
direct_xirr_info_set((pop_cppr() << 24) | hwirq);
}

static void xics_eoi_lpar(struct irq_data *d)
{
unsigned int irq = (unsigned int)irq_map[d->irq].hwirq;
unsigned int hwirq = (unsigned int)irq_map[d->irq].hwirq;

iosync();
lpar_xirr_info_set((pop_cppr() << 24) | irq);
lpar_xirr_info_set((pop_cppr() << 24) | hwirq);
}

static int
xics_set_affinity(struct irq_data *d, const struct cpumask *cpumask, bool force)
{
unsigned int irq;
unsigned int hwirq;
int status;
int xics_status[2];
int irq_server;

irq = (unsigned int)irq_map[d->irq].hwirq;
if (irq == XICS_IPI || irq == XICS_IRQ_SPURIOUS)
hwirq = (unsigned int)irq_map[d->irq].hwirq;
if (hwirq == XICS_IPI || hwirq == XICS_IRQ_SPURIOUS)
return -1;

status = rtas_call(ibm_get_xive, 1, 3, xics_status, irq);
status = rtas_call(ibm_get_xive, 1, 3, xics_status, hwirq);

if (status) {
printk(KERN_ERR "%s: ibm,get-xive irq=%u returns %d\n",
__func__, irq, status);
__func__, hwirq, status);
return -1;
}

Expand All @@ -418,11 +418,11 @@ xics_set_affinity(struct irq_data *d, const struct cpumask *cpumask, bool force)
}

status = rtas_call(ibm_set_xive, 3, 1, NULL,
irq, irq_server, xics_status[1]);
hwirq, irq_server, xics_status[1]);

if (status) {
printk(KERN_ERR "%s: ibm,set-xive irq=%u returns %d\n",
__func__, irq, status);
__func__, hwirq, status);
return -1;
}

Expand Down Expand Up @@ -874,7 +874,7 @@ void xics_kexec_teardown_cpu(int secondary)
void xics_migrate_irqs_away(void)
{
int cpu = smp_processor_id(), hw_cpu = hard_smp_processor_id();
unsigned int irq, virq;
int virq;

/* If we used to be the default server, move to the new "boot_cpuid" */
if (hw_cpu == default_server)
Expand All @@ -892,6 +892,7 @@ void xics_migrate_irqs_away(void)
for_each_irq(virq) {
struct irq_desc *desc;
struct irq_chip *chip;
unsigned int hwirq;
int xics_status[2];
int status;
unsigned long flags;
Expand All @@ -901,9 +902,9 @@ void xics_migrate_irqs_away(void)
continue;
if (irq_map[virq].host != xics_host)
continue;
irq = (unsigned int)irq_map[virq].hwirq;
hwirq = (unsigned int)irq_map[virq].hwirq;
/* We need to get IPIs still. */
if (irq == XICS_IPI || irq == XICS_IRQ_SPURIOUS)
if (hwirq == XICS_IPI || hwirq == XICS_IRQ_SPURIOUS)
continue;

desc = irq_to_desc(virq);
Expand All @@ -918,10 +919,10 @@ void xics_migrate_irqs_away(void)

raw_spin_lock_irqsave(&desc->lock, flags);

status = rtas_call(ibm_get_xive, 1, 3, xics_status, irq);
status = rtas_call(ibm_get_xive, 1, 3, xics_status, hwirq);
if (status) {
printk(KERN_ERR "%s: ibm,get-xive irq=%u returns %d\n",
__func__, irq, status);
__func__, hwirq, status);
goto unlock;
}

Expand Down

0 comments on commit ce0a502

Please sign in to comment.