public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* PATCH: IDE - sensible probing for PCI systems
@ 2005-06-21 12:23 Alan Cox
  2005-06-21 13:42 ` Maciej W. Rozycki
  0 siblings, 1 reply; 15+ messages in thread
From: Alan Cox @ 2005-06-21 12:23 UTC (permalink / raw)
  To: Linux Kernel Mailing List, akpm

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


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

end of thread, other threads:[~2005-06-27 20:34 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-06-21 12:23 PATCH: IDE - sensible probing for PCI systems Alan Cox
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox