[PATCH] pseries: don't die if unknown/missing interrupt controller property

STALE6964d

5 messages, 2 authors, 2007-07-09 · open the first message on its own page

[PATCH] pseries: don't die if unknown/missing interrupt controller property

From: Sonny Rao <hidden>
Date: 2007-07-02 02:29:57

The pseries platform does not have a default function for init_IRQ and
does not install one if it doesn't find or doesn't recognize an
interrupt controller in the device tree.  Currently, the kernel dies
when it tries to call the NULL init_IRQ() function.  Clean that up.

Signed-off-by: Sonny Rao <redacted>
--- kernel/arch/powerpc/platforms/pseries/setup.c~orig	2007-06-26 16:23:38.000000000 -0500
+++ kernel/arch/powerpc/platforms/pseries/setup.c	2007-06-26 19:09:53.000000000 -0500
@@ -274,6 +274,12 @@ static void pseries_lpar_enable_pmcs(voi
 		get_lppaca()->pmcregs_in_use = 1;
 }
 
+static void no_irq_init(void)
+{
+	printk(KERN_ERR "no_irq_init: failed to recognize"
+	       " interrupt-controller\n");
+}
+
 static void __init pseries_discover_pic(void)
 {
 	struct device_node *np;
@@ -296,8 +302,6 @@ static void __init pseries_discover_pic(
 			return;
 		}
 	}
-	printk(KERN_ERR "pSeries_discover_pic: failed to recognize"
-	       " interrupt-controller\n");
 }
 
 static void __init pSeries_setup_arch(void)
@@ -594,4 +598,5 @@ define_machine(pseries) {
 	.check_legacy_ioport	= pSeries_check_legacy_ioport,
 	.system_reset_exception = pSeries_system_reset_exception,
 	.machine_check_exception = pSeries_machine_check_exception,
+	.init_IRQ		= no_irq_init,  
 };

Re: [PATCH] pseries: don't die if unknown/missing interrupt controller property

From: Sonny Rao <hidden>
Date: 2007-07-05 03:25:12

On Sun, Jul 01, 2007 at 08:49:37PM -0400, Sonny Rao wrote:
quoted hunk
The pseries platform does not have a default function for init_IRQ and
does not install one if it doesn't find or doesn't recognize an
interrupt controller in the device tree.  Currently, the kernel dies
when it tries to call the NULL init_IRQ() function.  Clean that up.

Signed-off-by: Sonny Rao <redacted>
--- kernel/arch/powerpc/platforms/pseries/setup.c~orig	2007-06-26 16:23:38.000000000 -0500
+++ kernel/arch/powerpc/platforms/pseries/setup.c	2007-06-26 19:09:53.000000000 -0500
@@ -274,6 +274,12 @@ static void pseries_lpar_enable_pmcs(voi
 		get_lppaca()->pmcregs_in_use = 1;
 }
 
+static void no_irq_init(void)
+{
+	printk(KERN_ERR "no_irq_init: failed to recognize"
+	       " interrupt-controller\n");
+}
+
 static void __init pseries_discover_pic(void)
 {
 	struct device_node *np;
@@ -296,8 +302,6 @@ static void __init pseries_discover_pic(
 			return;
 		}
 	}
-	printk(KERN_ERR "pSeries_discover_pic: failed to recognize"
-	       " interrupt-controller\n");
 }
 
 static void __init pSeries_setup_arch(void)
@@ -594,4 +598,5 @@ define_machine(pseries) {
 	.check_legacy_ioport	= pSeries_check_legacy_ioport,
 	.system_reset_exception = pSeries_system_reset_exception,
 	.machine_check_exception = pSeries_machine_check_exception,
+	.init_IRQ		= no_irq_init,  
 };

Hi Paul, if there's no objection I'd like this to go into 2.6.23 thanks.

Re: [PATCH] pseries: don't die if unknown/missing interrupt controller property

From: Olof Johansson <hidden>
Date: 2007-07-05 13:26:51

On Sun, Jul 01, 2007 at 08:49:37PM -0400, Sonny Rao wrote:
The pseries platform does not have a default function for init_IRQ and
does not install one if it doesn't find or doesn't recognize an
interrupt controller in the device tree.  Currently, the kernel dies
when it tries to call the NULL init_IRQ() function.  Clean that up.
Doesn't it make more sense to make init_IRQ() check that the pointer is
set instead? That'll work for more platforms than just pseries.


-Olof

Re: [PATCH] pseries: don't die if unknown/missing interrupt controller property

From: Sonny Rao <hidden>
Date: 2007-07-06 09:39:22

On Thu, Jul 05, 2007 at 08:37:34AM -0500, Olof Johansson wrote:
On Sun, Jul 01, 2007 at 08:49:37PM -0400, Sonny Rao wrote:
quoted
The pseries platform does not have a default function for init_IRQ and
does not install one if it doesn't find or doesn't recognize an
interrupt controller in the device tree.  Currently, the kernel dies
when it tries to call the NULL init_IRQ() function.  Clean that up.
Doesn't it make more sense to make init_IRQ() check that the pointer is
set instead? That'll work for more platforms than just pseries.
Yeah, that might be the simplest way.  The only reason I can think of
to do it this way is that (I think) every single other platform in
arch/powerpc statically initializes init_IRQ, with pseries being the
oddball.  It doesn't matter much to me, so I can post another patch in a
bit.

Sonny

Re: [PATCH] [POWERPC] check for NULL ppc_md.init_IRQ() before calling

From: Sonny Rao <hidden>
Date: 2007-07-09 17:54:55

On Fri, Jul 06, 2007 at 05:16:34AM -0400, Sonny Rao wrote:
On Thu, Jul 05, 2007 at 08:37:34AM -0500, Olof Johansson wrote:
quoted
On Sun, Jul 01, 2007 at 08:49:37PM -0400, Sonny Rao wrote:
quoted
The pseries platform does not have a default function for init_IRQ and
does not install one if it doesn't find or doesn't recognize an
interrupt controller in the device tree.  Currently, the kernel dies
when it tries to call the NULL init_IRQ() function.  Clean that up.
Doesn't it make more sense to make init_IRQ() check that the pointer is
set instead? That'll work for more platforms than just pseries.
Yeah, that might be the simplest way.  The only reason I can think of
to do it this way is that (I think) every single other platform in
arch/powerpc statically initializes init_IRQ, with pseries being the
oddball.  It doesn't matter much to me, so I can post another patch in a
bit.
Check to make sure ppc_md.init_IRQ exists before calling it.

Signed-off-by: Sonny Rao <redacted>
--- linux/arch/powerpc/kernel/irq.c~orig 2007-07-09 12:46:58.000000000 -0500
+++ linux/arch/powerpc/kernel/irq.c 2007-07-09 12:47:07.000000000 -0500
@@ -337,8 +337,8 @@ void do_IRQ(struct pt_regs *regs)
 
 void __init init_IRQ(void)
 {
-
-	ppc_md.init_IRQ();
+	if (ppc_md.init_IRQ)
+		ppc_md.init_IRQ();
 #ifdef CONFIG_PPC64
 	irq_ctx_init();
 #endif
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help