linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc: Fix CHRP platforms with only 8259
@ 2006-10-25  2:54 Benjamin Herrenschmidt
  2006-10-25  3:11 ` Michael Ellerman
  0 siblings, 1 reply; 4+ messages in thread
From: Benjamin Herrenschmidt @ 2006-10-25  2:54 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev list

On CHRP platforms with only a 8259 controller, we should set the
default IRQ host to the 8259 driver's one for the IRQ probing
fallbacks to work in case the IRQ tree is incorrect (like on
Pegasos for example). Without this fix, we get a bunch of WARN_ON's
during boot.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>


Index: linux-cell/arch/powerpc/platforms/chrp/setup.c
===================================================================
--- linux-cell.orig/arch/powerpc/platforms/chrp/setup.c	2006-10-09 12:03:33.000000000 +1000
+++ linux-cell/arch/powerpc/platforms/chrp/setup.c	2006-10-25 12:51:18.000000000 +1000
@@ -477,8 +477,10 @@ static void __init chrp_find_8259(void)
 		       " address, polling\n");
 
 	i8259_init(pic, chrp_int_ack);
-	if (ppc_md.get_irq == NULL)
+	if (ppc_md.get_irq == NULL) {
 		ppc_md.get_irq = i8259_irq;
+		irq_set_default_host(i8259_get_host());
+	}
 	if (chrp_mpic != NULL) {
 		cascade_irq = irq_of_parse_and_map(pic, 0);
 		if (cascade_irq == NO_IRQ)
Index: linux-cell/arch/powerpc/sysdev/i8259.c
===================================================================
--- linux-cell.orig/arch/powerpc/sysdev/i8259.c	2006-10-09 12:03:33.000000000 +1000
+++ linux-cell/arch/powerpc/sysdev/i8259.c	2006-10-25 12:51:58.000000000 +1000
@@ -13,6 +13,7 @@
 #include <linux/interrupt.h>
 #include <linux/kernel.h>
 #include <linux/delay.h>
+#include <linux/module.h>
 #include <asm/io.h>
 #include <asm/i8259.h>
 #include <asm/prom.h>
@@ -224,6 +225,11 @@ static struct irq_host_ops i8259_host_op
 	.xlate = i8259_host_xlate,
 };
 
+struct irq_host *i8259_get_host(void)
+{
+	return i8259_host;
+}
+
 /**
  * i8259_init - Initialize the legacy controller
  * @node: device node of the legacy PIC (can be NULL, but then, it will match
Index: linux-cell/include/asm-powerpc/i8259.h
===================================================================
--- linux-cell.orig/include/asm-powerpc/i8259.h	2006-10-09 12:03:34.000000000 +1000
+++ linux-cell/include/asm-powerpc/i8259.h	2006-10-25 12:51:18.000000000 +1000
@@ -7,6 +7,7 @@
 #ifdef CONFIG_PPC_MERGE
 extern void i8259_init(struct device_node *node, unsigned long intack_addr);
 extern unsigned int i8259_irq(void);
+extern struct irq_host *i8259_get_host(void);
 #else
 extern void i8259_init(unsigned long intack_addr, int offset);
 extern int i8259_irq(void);

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] powerpc: Fix CHRP platforms with only 8259
  2006-10-25  2:54 Benjamin Herrenschmidt
@ 2006-10-25  3:11 ` Michael Ellerman
  2006-10-25  3:21   ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Ellerman @ 2006-10-25  3:11 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev list, Paul Mackerras

[-- Attachment #1: Type: text/plain, Size: 1970 bytes --]

On Wed, 2006-10-25 at 12:54 +1000, Benjamin Herrenschmidt wrote:
> On CHRP platforms with only a 8259 controller, we should set the
> default IRQ host to the 8259 driver's one for the IRQ probing
> fallbacks to work in case the IRQ tree is incorrect (like on
> Pegasos for example). Without this fix, we get a bunch of WARN_ON's
> during boot.
> 
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> 
> 
> Index: linux-cell/arch/powerpc/platforms/chrp/setup.c
> ===================================================================
> --- linux-cell.orig/arch/powerpc/platforms/chrp/setup.c	2006-10-09 12:03:33.000000000 +1000
> +++ linux-cell/arch/powerpc/platforms/chrp/setup.c	2006-10-25 12:51:18.000000000 +1000
> @@ -477,8 +477,10 @@ static void __init chrp_find_8259(void)
>  		       " address, polling\n");
>  
>  	i8259_init(pic, chrp_int_ack);
> -	if (ppc_md.get_irq == NULL)
> +	if (ppc_md.get_irq == NULL) {
>  		ppc_md.get_irq = i8259_irq;
> +		irq_set_default_host(i8259_get_host());
> +	}
>  	if (chrp_mpic != NULL) {
>  		cascade_irq = irq_of_parse_and_map(pic, 0);
>  		if (cascade_irq == NO_IRQ)
> Index: linux-cell/arch/powerpc/sysdev/i8259.c
> ===================================================================
> --- linux-cell.orig/arch/powerpc/sysdev/i8259.c	2006-10-09 12:03:33.000000000 +1000
> +++ linux-cell/arch/powerpc/sysdev/i8259.c	2006-10-25 12:51:58.000000000 +1000
> @@ -13,6 +13,7 @@
>  #include <linux/interrupt.h>
>  #include <linux/kernel.h>
>  #include <linux/delay.h>
> +#include <linux/module.h>
>  #include <asm/io.h>
>  #include <asm/i8259.h>
>  #include <asm/prom.h>

You don't need module.h anymore do you ? :D

cheers

-- 
Michael Ellerman
OzLabs, IBM Australia Development Lab

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 191 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] powerpc: Fix CHRP platforms with only 8259
  2006-10-25  3:11 ` Michael Ellerman
@ 2006-10-25  3:21   ` Benjamin Herrenschmidt
  0 siblings, 0 replies; 4+ messages in thread
From: Benjamin Herrenschmidt @ 2006-10-25  3:21 UTC (permalink / raw)
  To: michael; +Cc: linuxppc-dev list, Paul Mackerras


> You don't need module.h anymore do you ? :D

Bloody you ! :)

New patch on the way.

Ben.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] powerpc: Fix CHRP platforms with only 8259
@ 2006-10-25  3:22 Benjamin Herrenschmidt
  0 siblings, 0 replies; 4+ messages in thread
From: Benjamin Herrenschmidt @ 2006-10-25  3:22 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev list

On CHRP platforms with only a 8259 controller, we should set the
default IRQ host to the 8259 driver's one for the IRQ probing
fallbacks to work in case the IRQ tree is incorrect (like on
Pegasos for example). Without this fix, we get a bunch of WARN_ON's
during boot.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---

This one without the spurrious #include. Please apply to 2.6.19

Index: linux-cell/arch/powerpc/platforms/chrp/setup.c
===================================================================
--- linux-cell.orig/arch/powerpc/platforms/chrp/setup.c	2006-10-09 12:03:33.000000000 +1000
+++ linux-cell/arch/powerpc/platforms/chrp/setup.c	2006-10-25 12:51:18.000000000 +1000
@@ -477,8 +477,10 @@ static void __init chrp_find_8259(void)
 		       " address, polling\n");
 
 	i8259_init(pic, chrp_int_ack);
-	if (ppc_md.get_irq == NULL)
+	if (ppc_md.get_irq == NULL) {
 		ppc_md.get_irq = i8259_irq;
+		irq_set_default_host(i8259_get_host());
+	}
 	if (chrp_mpic != NULL) {
 		cascade_irq = irq_of_parse_and_map(pic, 0);
 		if (cascade_irq == NO_IRQ)
Index: linux-cell/arch/powerpc/sysdev/i8259.c
===================================================================
--- linux-cell.orig/arch/powerpc/sysdev/i8259.c	2006-10-09 12:03:33.000000000 +1000
+++ linux-cell/arch/powerpc/sysdev/i8259.c	2006-10-25 13:19:33.000000000 +1000
@@ -224,6 +224,11 @@ static struct irq_host_ops i8259_host_op
 	.xlate = i8259_host_xlate,
 };
 
+struct irq_host *i8259_get_host(void)
+{
+	return i8259_host;
+}
+
 /**
  * i8259_init - Initialize the legacy controller
  * @node: device node of the legacy PIC (can be NULL, but then, it will match
Index: linux-cell/include/asm-powerpc/i8259.h
===================================================================
--- linux-cell.orig/include/asm-powerpc/i8259.h	2006-10-09 12:03:34.000000000 +1000
+++ linux-cell/include/asm-powerpc/i8259.h	2006-10-25 12:51:18.000000000 +1000
@@ -7,6 +7,7 @@
 #ifdef CONFIG_PPC_MERGE
 extern void i8259_init(struct device_node *node, unsigned long intack_addr);
 extern unsigned int i8259_irq(void);
+extern struct irq_host *i8259_get_host(void);
 #else
 extern void i8259_init(unsigned long intack_addr, int offset);
 extern int i8259_irq(void);

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-10-25  3:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-25  3:22 [PATCH] powerpc: Fix CHRP platforms with only 8259 Benjamin Herrenschmidt
  -- strict thread matches above, loose matches on Subject: below --
2006-10-25  2:54 Benjamin Herrenschmidt
2006-10-25  3:11 ` Michael Ellerman
2006-10-25  3:21   ` Benjamin Herrenschmidt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).