diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-09-14 17:00:35 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-09-14 17:00:35 -0400 |
commit | 7eeac505d912cfe5805290f8f9e293b134e00237 (patch) | |
tree | 32b1e61bd01e390d4db24fba5ca941580c6db8ba /include | |
parent | 22d95b1282810f5af599ee292b3fc443aefbdad0 (diff) | |
parent | 50da469a79fa2152d824f25f5ad5962f4af4343d (diff) |
Merge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus
* 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus:
[MIPS] 20Kc: Disable use of WAIT instruction.
[MIPS] Workaround for 4Kc machine check exception
[MIPS] Malta: Fix off by one bug in interrupt handler.
[MIPS] No ide_default_io_base() if PCI IDE was not found
[MIPS] Add #include <linux/profile.h> to arch/mips/kernel/time.c
[MIPS] N32 needs to use compat_sys_futimesat
[MIPS] rtlx: Fix build error.
[MIPS] rtlx: fix int vs. long bug.
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-mips/mach-generic/ide.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/include/asm-mips/mach-generic/ide.h b/include/asm-mips/mach-generic/ide.h index 2b928577be5d..a77128362a7d 100644 --- a/include/asm-mips/mach-generic/ide.h +++ b/include/asm-mips/mach-generic/ide.h | |||
@@ -29,6 +29,35 @@ | |||
29 | 29 | ||
30 | #define IDE_ARCH_OBSOLETE_DEFAULTS | 30 | #define IDE_ARCH_OBSOLETE_DEFAULTS |
31 | 31 | ||
32 | static __inline__ int ide_probe_legacy(void) | ||
33 | { | ||
34 | #ifdef CONFIG_PCI | ||
35 | struct pci_dev *dev; | ||
36 | /* | ||
37 | * This can be called on the ide_setup() path, super-early in | ||
38 | * boot. But the down_read() will enable local interrupts, | ||
39 | * which can cause some machines to crash. So here we detect | ||
40 | * and flag that situation and bail out early. | ||
41 | */ | ||
42 | if (no_pci_devices()) | ||
43 | return 0; | ||
44 | dev = pci_get_class(PCI_CLASS_BRIDGE_EISA << 8, NULL); | ||
45 | if (dev) | ||
46 | goto found; | ||
47 | dev = pci_get_class(PCI_CLASS_BRIDGE_ISA << 8, NULL); | ||
48 | if (dev) | ||
49 | goto found; | ||
50 | return 0; | ||
51 | found: | ||
52 | pci_dev_put(dev); | ||
53 | return 1; | ||
54 | #elif defined(CONFIG_EISA) || defined(CONFIG_ISA) | ||
55 | return 1; | ||
56 | #else | ||
57 | return 0; | ||
58 | #endif | ||
59 | } | ||
60 | |||
32 | static __inline__ int ide_default_irq(unsigned long base) | 61 | static __inline__ int ide_default_irq(unsigned long base) |
33 | { | 62 | { |
34 | switch (base) { | 63 | switch (base) { |
@@ -45,6 +74,8 @@ static __inline__ int ide_default_irq(unsigned long base) | |||
45 | 74 | ||
46 | static __inline__ unsigned long ide_default_io_base(int index) | 75 | static __inline__ unsigned long ide_default_io_base(int index) |
47 | { | 76 | { |
77 | if (!ide_probe_legacy()) | ||
78 | return 0; | ||
48 | /* | 79 | /* |
49 | * If PCI is present then it is not safe to poke around | 80 | * If PCI is present then it is not safe to poke around |
50 | * the other legacy IDE ports. Only 0x1f0 and 0x170 are | 81 | * the other legacy IDE ports. Only 0x1f0 and 0x170 are |