diff options
author | Anton Blanchard <anton@samba.org> | 2004-08-07 00:56:42 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-08-07 00:56:42 -0700 |
commit | 24ab65e8181dc0ce7a501af727193fc8a3715131 (patch) | |
tree | ea0a4216309a83f80d353c694e428bb41c5befb1 /arch | |
parent | 814e07776c6b120425c92f1690137785bf2cb5a9 (diff) | |
download | history-24ab65e8181dc0ce7a501af727193fc8a3715131.tar.gz |
[PATCH] ppc64: various XICS fixes
- Remove unused includes.
- Be consistent about printing irq numbers, avoid a mix of decimal and
hexadecimal.
- Remove prototypes from xics.c, they should be in xics.h.
- Remove infinite loop on failure, and instead use panic. Panic has a chance to
log the error message on the LED panel and reboot the box, a while(1) loop
does not.
- xics isnt compiled for iseries any more, so no need for the
CONFIG_PPC_PSERIES hack.
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/ppc64/kernel/xics.c | 52 |
1 files changed, 18 insertions, 34 deletions
diff --git a/arch/ppc64/kernel/xics.c b/arch/ppc64/kernel/xics.c index a881d25f1f1393..8a0d07650106dc 100644 --- a/arch/ppc64/kernel/xics.c +++ b/arch/ppc64/kernel/xics.c @@ -27,7 +27,6 @@ #include <asm/naca.h> #include <asm/rtas.h> #include <asm/xics.h> -#include <asm/ppcdebug.h> #include <asm/hvcall.h> #include <asm/machdep.h> @@ -286,7 +285,7 @@ static void xics_enable_irq(unsigned int virq) call_status = rtas_call(ibm_set_xive, 3, 1, NULL, irq, server, DEFAULT_PRIORITY); if (call_status != 0) { - printk(KERN_ERR "xics_enable_irq: irq=%x: ibm_set_xive " + printk(KERN_ERR "xics_enable_irq: irq=%d: ibm_set_xive " "returned %x\n", irq, call_status); return; } @@ -294,7 +293,7 @@ static void xics_enable_irq(unsigned int virq) /* Now unmask the interrupt (often a no-op) */ call_status = rtas_call(ibm_int_on, 1, 1, NULL, irq); if (call_status != 0) { - printk(KERN_ERR "xics_enable_irq: irq=%x: ibm_int_on " + printk(KERN_ERR "xics_enable_irq: irq=%d: ibm_int_on " "returned %x\n", irq, call_status); return; } @@ -310,7 +309,7 @@ static void xics_disable_real_irq(unsigned int irq) call_status = rtas_call(ibm_int_off, 1, 1, NULL, irq); if (call_status != 0) { - printk(KERN_ERR "xics_disable_real_irq: irq=%x: " + printk(KERN_ERR "xics_disable_real_irq: irq=%d: " "ibm_int_off returned %x\n", irq, call_status); return; } @@ -319,7 +318,7 @@ static void xics_disable_real_irq(unsigned int irq) /* Have to set XIVE to 0xff to be able to remove a slot */ call_status = rtas_call(ibm_set_xive, 3, 1, NULL, irq, server, 0xff); if (call_status != 0) { - printk(KERN_ERR "xics_disable_irq: irq=%x: ibm_set_xive(0xff)" + printk(KERN_ERR "xics_disable_irq: irq=%d: ibm_set_xive(0xff)" " returned %x\n", irq, call_status); return; } @@ -356,8 +355,6 @@ static void xics_mask_and_ack_irq(unsigned int irq) } } -extern unsigned int real_irq_to_virt_slowpath(unsigned int real_irq); - int xics_get_irq(struct pt_regs *regs) { unsigned int cpu = smp_processor_id(); @@ -384,7 +381,7 @@ int xics_get_irq(struct pt_regs *regs) if (irq == NO_IRQ) irq = real_irq_to_virt_slowpath(vec); if (irq == NO_IRQ) { - printk(KERN_ERR "Interrupt 0x%x (real) is invalid," + printk(KERN_ERR "Interrupt %d (real) is invalid," " disabling it.\n", vec); xics_disable_real_irq(vec); } else @@ -395,8 +392,6 @@ int xics_get_irq(struct pt_regs *regs) #ifdef CONFIG_SMP -extern struct xics_ipi_struct xics_ipi_message[NR_CPUS] __cacheline_aligned; - irqreturn_t xics_ipi_action(int irq, void *dev_id, struct pt_regs *regs) { int cpu = smp_processor_id(); @@ -469,11 +464,9 @@ void xics_init_IRQ(void) ibm_int_off = rtas_token("ibm,int-off"); np = of_find_node_by_type(NULL, "PowerPC-External-Interrupt-Presentation"); - if (!np) { - printk(KERN_WARNING "Can't find Interrupt Presentation\n"); - udbg_printf("Can't find Interrupt Presentation\n"); - while (1); - } + if (!np) + panic("xics_init_IRQ: can't find interrupt presentation"); + nextnode: ireg = (uint *)get_property(np, "ibm,interrupt-server-ranges", NULL); if (ireg) { @@ -484,11 +477,8 @@ nextnode: } ireg = (uint *)get_property(np, "reg", &ilen); - if (!ireg) { - printk(KERN_WARNING "Can't find Interrupt Reg Property\n"); - udbg_printf("Can't find Interrupt Reg Property\n"); - while (1); - } + if (!ireg) + panic("xics_init_IRQ: can't find interrupt reg property"); while (ilen) { inodes[indx].addr = (unsigned long long)*ireg++ << 32; @@ -528,16 +518,14 @@ nextnode: np = of_find_node_by_type(NULL, "interrupt-controller"); if (!np) { - printk(KERN_WARNING "xics: no ISA Interrupt Controller\n"); + printk(KERN_WARNING "xics: no ISA interrupt controller\n"); xics_irq_8259_cascade_real = -1; xics_irq_8259_cascade = -1; } else { ireg = (uint *) get_property(np, "interrupts", NULL); - if (!ireg) { - printk(KERN_WARNING "Can't find ISA Interrupts Property\n"); - udbg_printf("Can't find ISA Interrupts Property\n"); - while (1); - } + if (!ireg) + panic("xics_init_IRQ: can't find ISA interrupts property"); + xics_irq_8259_cascade_real = *ireg; xics_irq_8259_cascade = virt_irq_create_mapping(xics_irq_8259_cascade_real); @@ -558,13 +546,8 @@ nextnode: xics_per_cpu[0] = __ioremap((ulong)intr_base, intr_size, _PAGE_NO_CACHE); #endif /* CONFIG_SMP */ -#ifdef CONFIG_PPC_PSERIES - /* actually iSeries does not use any of xics...but it has link dependencies - * for now, except this new one... - */ } else if (systemcfg->platform == PLATFORM_PSERIES_LPAR) { ops = &pSeriesLP_ops; -#endif } xics_8259_pic.enable = i8259_pic.enable; @@ -590,7 +573,8 @@ static int __init xics_setup_i8259(void) xics_irq_8259_cascade != -1) { if (request_irq(irq_offset_up(xics_irq_8259_cascade), no_action, 0, "8259 cascade", NULL)) - printk(KERN_ERR "xics_init_IRQ: couldn't get 8259 cascade\n"); + printk(KERN_ERR "xics_setup_i8259: couldn't get 8259 " + "cascade\n"); i8259_init(); } return 0; @@ -643,7 +627,7 @@ static void xics_set_affinity(unsigned int virq, cpumask_t cpumask) irq, newmask, xics_status[1]); if (status) { - printk(KERN_ERR "xics_set_affinity irq=%d ibm,set-xive " + printk(KERN_ERR "xics_set_affinity: irq=%d ibm,set-xive " "returns %d\n", irq, status); return; } @@ -723,7 +707,7 @@ void xics_migrate_irqs_away(void) status = rtas_call(ibm_set_xive, 3, 1, NULL, irq, xics_status[0], xics_status[1]); if (status) - printk(KERN_ERR "migrate_irqs_away irq=%d " + printk(KERN_ERR "migrate_irqs_away: irq=%d " "ibm,set-xive returns %d\n", virq, status); |