mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>, akpm@osdl.org
Subject: PATCH: IDE - sensible probing for PCI systems
Date: Tue, 21 Jun 2005 13:23:22 +0100	[thread overview]
Message-ID: <1119356601.3279.118.camel@localhost.localdomain> (raw)

Old ISA/VESA systems sometimes put tertiary IDE controllers at addresses
0x1e8, 0x168, 0x1e0 or 0x160. Linux thus probes these addresses on x86
systems. Unfortunately some PCI systems now use these addresses for
other purposes which leads to users seeing minute plus hangs during boot
or even crashes.

The following patch (again has been in Fedora for a while) only probes
the obscure legacy ISA ports on machinea that are pre-PCI. This seems to
keep everyone happy and if there is someone with that utterly weird
corner case the ide= command line still provides a get out of jail card.
Unsurprisingly we've not found anyone so affected.

Signed-off-by: Alan Cox <alan@redhat.com>

diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.12rc5/include/asm-i386/ide.h linux-2.6.12-rc5/include/asm-i386/ide.h
--- linux.vanilla-2.6.12rc5/include/asm-i386/ide.h	2005-05-27 15:15:42.000000000 +0100
+++ linux-2.6.12-rc5/include/asm-i386/ide.h	2005-05-27 15:43:28.000000000 +0100
@@ -41,16 +41,20 @@
 
 static __inline__ unsigned long ide_default_io_base(int index)
 {
+	if(pci_find_device(PCI_ANY_ID, PCI_ANY_ID, NULL) == NULL) {
+		switch(index) {
+			case 2: return 0x1e8;
+			case 3: return 0x168;
+			case 4: return 0x1e0;
+			case 5: return 0x160;
+			}
+	}
 	switch (index) {
 		case 0:	return 0x1f0;
 		case 1:	return 0x170;
-		case 2: return 0x1e8;
-		case 3: return 0x168;
-		case 4: return 0x1e0;
-		case 5: return 0x160;
 		default:
 			return 0;
-	}
+	}		
 }
 
 #define IDE_ARCH_OBSOLETE_INIT


             reply	other threads:[~2005-06-21 12:37 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-21 12:23 Alan Cox [this message]
2005-06-21 13:42 ` Maciej W. Rozycki
2005-06-21 14:12   ` Alan Cox
2005-06-21 15:10     ` Maciej W. Rozycki
2005-06-21 18:46       ` Alan Cox
2005-06-23 18:22         ` Maciej W. Rozycki
2005-06-23 22:48           ` Alan Cox
2005-06-24 11:52             ` Maciej W. Rozycki
2005-06-24 22:41               ` Jeff Garzik
2005-06-27 14:18                 ` Maciej W. Rozycki
2005-06-27 20:31                   ` Bill Davidsen
2005-06-25 12:32               ` Alan Cox
2005-06-27 14:55                 ` Maciej W. Rozycki
2005-06-27 16:24                   ` Russell King
2005-06-27 19:54                   ` Alan Cox

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=1119356601.3279.118.camel@localhost.localdomain \
    --to=alan@lxorguk.ukuu.org.uk \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®