mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
To: Linus Torvalds <torvalds@osdl.org>
Cc: "David S. Miller" <davem@redhat.com>,
	viro@parcelfarce.linux.theplanet.co.uk,
	dancraig@internode.on.net, linux-kernel@vger.kernel.org
Subject: Re: 2.6.0-test9-bk16 ALi M5229 kernel boot error
Date: Wed, 12 Nov 2003 19:39:34 +0300	[thread overview]
Message-ID: <20031112193934.A1688@jurassic.park.msu.ru> (raw)
In-Reply-To: <Pine.LNX.4.44.0311120749520.3288-100000@home.osdl.org>; from torvalds@osdl.org on Wed, Nov 12, 2003 at 07:52:11AM -0800

On Wed, Nov 12, 2003 at 07:52:11AM -0800, Linus Torvalds wrote:
> The whole thing should probably be done as a PCI quirk. Anyway, I'll
> change my patch to be the absolute minimal one, ie just adding the
> !isa_dev test instead of removing the old confused logic. I'm pretty 
> certain that we shouldn't touch those GPIO's at all, but since some boards 
> probably _do_ want them enabled, let's go for the minimal "avoid oops" 
> approach.

Agreed.

Hmm, I've just looked at current 2.4 driver - it does test the isa_dev
and also does nothing for revisions C5 and above, probably for reason.
What about this, cut'n'pasted from 2.4?

Ivan.

--- linux/drivers/ide/pci/alim15x3.c.orig	Wed Nov 12 19:05:48 2003
+++ linux/drivers/ide/pci/alim15x3.c	Wed Nov 12 19:11:14 2003
@@ -578,6 +578,7 @@ static unsigned int __init init_chipset_
 {
 	unsigned long flags;
 	u8 tmpbyte;
+	struct pci_dev *north = pci_find_slot(0, PCI_DEVFN(0,0));
 
 	pci_read_config_byte(dev, PCI_REVISION_ID, &m5229_revision);
 
@@ -624,30 +625,35 @@ static unsigned int __init init_chipset_
 
 	/*
 	 * We should only tune the 1533 enable if we are using an ALi
+	 * North bridge. We might have no north found on some zany
+	 * box without a device at 0:0.0. The ALi bridge will be at
+	 * 0:0.0 so if we didn't find one we know what is cooking.
 	 * south bridge.
 	 */
-	if (!isa_dev) {
+	if (north && north->vendor != PCI_VENDOR_ID_AL) {
 		local_irq_restore(flags);
 	        return 0;
 	}
 
-	/*
-	 * set south-bridge's enable bit, m1533, 0x79
-	 */
-
-	pci_read_config_byte(isa_dev, 0x79, &tmpbyte);
-	if (m5229_revision == 0xC2) {
+	if (m5229_revision < 0xC5 && isa_dev)
+	{	
 		/*
-		 * 1543C-B0 (m1533, 0x79, bit 2)
+		 * set south-bridge's enable bit, m1533, 0x79
 		 */
-		pci_write_config_byte(isa_dev, 0x79, tmpbyte | 0x04);
-	} else if (m5229_revision >= 0xC3) {
-		/*
-		 * 1553/1535 (m1533, 0x79, bit 1)
-		 */
-		pci_write_config_byte(isa_dev, 0x79, tmpbyte | 0x02);
-	}
 
+		pci_read_config_byte(isa_dev, 0x79, &tmpbyte);
+		if (m5229_revision == 0xC2) {
+			/*
+			 * 1543C-B0 (m1533, 0x79, bit 2)
+			 */
+			pci_write_config_byte(isa_dev, 0x79, tmpbyte | 0x04);
+		} else if (m5229_revision >= 0xC3) {
+			/*
+			 * 1553/1535 (m1533, 0x79, bit 1)
+			 */
+			pci_write_config_byte(isa_dev, 0x79, tmpbyte | 0x02);
+		}
+	}
 	local_irq_restore(flags);
 	return 0;
 }

      reply	other threads:[~2003-11-12 16:40 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-12  2:46 Daniel Craig
2003-11-12  3:04 ` Linus Torvalds
2003-11-12  3:50   ` Jeff Garzik
2003-11-12  4:36     ` viro
2003-11-12  5:29     ` Linus Torvalds
2003-11-12  4:21   ` Daniel Craig
2003-11-12  4:31   ` viro
2003-11-12  6:58     ` David S. Miller
2003-11-12 15:06       ` Ivan Kokshaysky
2003-11-12 15:52         ` Linus Torvalds
2003-11-12 16:39           ` Ivan Kokshaysky [this message]

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=20031112193934.A1688@jurassic.park.msu.ru \
    --to=ink@jurassic.park.msu.ru \
    --cc=dancraig@internode.on.net \
    --cc=davem@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.org \
    --cc=viro@parcelfarce.linux.theplanet.co.uk \
    /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

all inboxes | Powered by JetHome®