linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ppc32: Fix boot on PowerMac
@ 2004-10-29  3:29 Benjamin Herrenschmidt
  2004-10-29 12:03 ` Christoph Hellwig
  0 siblings, 1 reply; 3+ messages in thread
From: Benjamin Herrenschmidt @ 2004-10-29  3:29 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Linus Torvalds, Linux Kernel list

Hi !

Tom's recent irq patch broke PowerMac (and possibly others). I think
he forgot that PReP, CHRP and PowerMac are all built together in a
single kernel image, thus all of those arch_initcall's will end up
beeing called, even on the wrong machine...

This fixes it.

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

Index: linux-work/arch/ppc/platforms/chrp_setup.c
===================================================================
--- linux-work.orig/arch/ppc/platforms/chrp_setup.c	2004-10-29 10:46:32.000000000 +1000
+++ linux-work/arch/ppc/platforms/chrp_setup.c	2004-10-29 13:15:59.171074120 +1000
@@ -374,6 +374,9 @@
 static int __init
 chrp_request_cascade(void)
 {
+	if (_machine != _MACH_chrp)
+		return 0;
+
 	/* We have a cascade on OpenPIC IRQ 0, Linux IRQ 16 */
 	openpic_hookup_cascade(NUM_8259_INTERRUPTS, "82c59 cascade",
 			       i8259_irq);
Index: linux-work/arch/ppc/syslib/i8259.c
===================================================================
--- linux-work.orig/arch/ppc/syslib/i8259.c	2004-10-29 10:46:32.000000000 +1000
+++ linux-work/arch/ppc/syslib/i8259.c	2004-10-29 13:20:45.392561840 +1000
@@ -13,6 +13,7 @@
 static spinlock_t i8259_lock = SPIN_LOCK_UNLOCKED;
 
 int i8259_pic_irq_offset;
+static int i8259_present;
 
 /*
  * Acknowledge the IRQ using either the PCI host bridge's interrupt
@@ -154,6 +155,9 @@
 static int __init
 i8259_hook_cascade(void)
 {
+	if (!i8259_present)
+		return 0;
+
 	/* reserve our resources */
 	request_irq( i8259_pic_irq_offset + 2, no_action, SA_INTERRUPT,
 				"82c59 secondary cascade", NULL );
@@ -201,4 +205,6 @@
 
 	if (intack_addr != 0)
 		pci_intack = ioremap(intack_addr, 1);
+
+	i8259_present = 1;
 }
Index: linux-work/arch/ppc/platforms/prep_setup.c
===================================================================
--- linux-work.orig/arch/ppc/platforms/prep_setup.c	2004-10-29 10:46:32.000000000 +1000
+++ linux-work/arch/ppc/platforms/prep_setup.c	2004-10-29 13:19:31.656771384 +1000
@@ -961,6 +961,9 @@
 static int __init
 prep_request_cascade(void)
 {
+	if (_machine != _MACH_prep)
+		return 0;
+
 	if (OpenPIC_Addr != NULL)
 		/* We have a cascade on OpenPIC IRQ 0, Linux IRQ 16 */
 		openpic_hookup_cascade(NUM_8259_INTERRUPTS, "82c59 cascade",



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

* Re: [PATCH] ppc32: Fix boot on PowerMac
  2004-10-29  3:29 [PATCH] ppc32: Fix boot on PowerMac Benjamin Herrenschmidt
@ 2004-10-29 12:03 ` Christoph Hellwig
  2004-10-29 23:25   ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 3+ messages in thread
From: Christoph Hellwig @ 2004-10-29 12:03 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: Andrew Morton, Linus Torvalds, Linux Kernel list

On Fri, Oct 29, 2004 at 01:29:46PM +1000, Benjamin Herrenschmidt wrote:
> Hi !
> 
> Tom's recent irq patch broke PowerMac (and possibly others). I think
> he forgot that PReP, CHRP and PowerMac are all built together in a
> single kernel image, thus all of those arch_initcall's will end up
> beeing called, even on the wrong machine...

Better rewvert Tom's fix and switch all these early calls to setup_irq,
like I did for pmac and a few other subarches (I missed the ones Tom
fixed, sorry)


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

* Re: [PATCH] ppc32: Fix boot on PowerMac
  2004-10-29 12:03 ` Christoph Hellwig
@ 2004-10-29 23:25   ` Benjamin Herrenschmidt
  0 siblings, 0 replies; 3+ messages in thread
From: Benjamin Herrenschmidt @ 2004-10-29 23:25 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: Andrew Morton, Linus Torvalds, Linux Kernel list

On Fri, 2004-10-29 at 13:03 +0100, Christoph Hellwig wrote:
> On Fri, Oct 29, 2004 at 01:29:46PM +1000, Benjamin Herrenschmidt wrote:
> > Hi !
> > 
> > Tom's recent irq patch broke PowerMac (and possibly others). I think
> > he forgot that PReP, CHRP and PowerMac are all built together in a
> > single kernel image, thus all of those arch_initcall's will end up
> > beeing called, even on the wrong machine...
> 
> Better rewvert Tom's fix and switch all these early calls to setup_irq,
> like I did for pmac and a few other subarches (I missed the ones Tom
> fixed, sorry)

Patch welcome :)

Ben.



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

end of thread, other threads:[~2004-10-29 23:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-29  3:29 [PATCH] ppc32: Fix boot on PowerMac Benjamin Herrenschmidt
2004-10-29 12:03 ` Christoph Hellwig
2004-10-29 23:25   ` 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).