aboutsummaryrefslogtreecommitdiffstats
path: root/debian/patches/mips-ide-scan.patch
blob: ad2a3da0cdd4772b8b003f6510cab4a8ea4c03ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
## DP: Fix long IDE detection delay by not scanning non-existent channels.
## DP: Patch author: Peter Horton <pdh@colonel-panic.org>
## DP: Upstream status: submitted to linux-mips

# Fix long delay during Cobalt boot whilst scanning non-existent
# interfaces. The logic is copied from i386 i.e. we only scan 2 legacy
# ports if we have PCI IDE.

# Signed-off-by: Peter Horton <pdh@colonel-panic.org>
# Acked-by: Alan Cox <alan@lxorguk.ukuu.org.uk>

--- linux.git.orig/include/asm-mips/mach-generic/ide.h	2006-01-24 22:07:36.000000000 +0000
+++ linux.git/include/asm-mips/mach-generic/ide.h	2006-01-24 23:41:19.000000000 +0000
@@ -30,7 +30,7 @@
 
 #define IDE_ARCH_OBSOLETE_DEFAULTS
 
-static __inline__ int ide_probe_legacy(void)
+static __inline__ int ide_legacy_ports(void)
 {
 #ifdef CONFIG_PCI
 	struct pci_dev *dev;
@@ -38,11 +38,11 @@
 	    (dev = pci_get_class(PCI_CLASS_BRIDGE_ISA << 8, NULL)) != NULL) {
 		pci_dev_put(dev);
 
-		return 1;
+		return 2;
 	}
 	return 0;
 #elif defined(CONFIG_EISA) || defined(CONFIG_ISA)
-	return 1;
+	return 6;
 #else
 	return 0;
 #endif
@@ -50,30 +50,26 @@
 
 static __inline__ int ide_default_irq(unsigned long base)
 {
-	if (ide_probe_legacy())
-		switch (base) {
-		case 0x1f0:
-			return 14;
-		case 0x170:
-			return 15;
-		case 0x1e8:
-			return 11;
-		case 0x168:
-			return 10;
-		case 0x1e0:
-			return 8;
-		case 0x160:
-			return 12;
-		default:
-			return 0;
-		}
-	else
-		return 0;
+	switch (base) {
+	case 0x1f0:
+		return 14;
+	case 0x170:
+		return 15;
+	case 0x1e8:
+		return 11;
+	case 0x168:
+		return 10;
+	case 0x1e0:
+		return 8;
+	case 0x160:
+		return 12;
+	}
+	return 0;
 }
 
 static __inline__ unsigned long ide_default_io_base(int index)
 {
-	if (ide_probe_legacy())
+	if (index < ide_legacy_ports())
 		switch (index) {
 		case 0:
 			return 0x1f0;
@@ -87,11 +83,8 @@
 			return 0x1e0;
 		case 5:
 			return 0x160;
-		default:
-			return 0;
-		}
-	else
-		return 0;
+	}
+	return 0;
 }
 
 #define IDE_ARCH_OBSOLETE_INIT