PATCH: IDE - sensible probing for PCI systems

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <[email protected]>

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

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux