public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Andrew Morton <akpm@osdl.org>
Cc: Linus Torvalds <torvalds@osdl.org>,
	Linux Kernel list <linux-kernel@vger.kernel.org>
Subject: [PATCH] ppc32: Fix boot on PowerMac
Date: Fri, 29 Oct 2004 13:29:46 +1000	[thread overview]
Message-ID: <1099020586.29693.105.camel@gaston> (raw)

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",



             reply	other threads:[~2004-10-29  3:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-29  3:29 Benjamin Herrenschmidt [this message]
2004-10-29 12:03 ` [PATCH] ppc32: Fix boot on PowerMac Christoph Hellwig
2004-10-29 23:25   ` Benjamin Herrenschmidt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1099020586.29693.105.camel@gaston \
    --to=benh@kernel.crashing.org \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox