Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 64934
b: refs/heads/master
c: 6440fcf
h: refs/heads/master
v: v3
  • Loading branch information
Atsushi Nemoto authored and Ralf Baechle committed Sep 14, 2007
1 parent 1ea39af commit 0ffdb28
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b1043cc7d9d7a7dec8d807570c067e0c90b94b57
refs/heads/master: 6440fcfc62767028a2bbdf742549d24f6a023004
31 changes: 31 additions & 0 deletions trunk/include/asm-mips/mach-generic/ide.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,35 @@

#define IDE_ARCH_OBSOLETE_DEFAULTS

static __inline__ int ide_probe_legacy(void)
{
#ifdef CONFIG_PCI
struct pci_dev *dev;
/*
* This can be called on the ide_setup() path, super-early in
* boot. But the down_read() will enable local interrupts,
* which can cause some machines to crash. So here we detect
* and flag that situation and bail out early.
*/
if (no_pci_devices())
return 0;
dev = pci_get_class(PCI_CLASS_BRIDGE_EISA << 8, NULL);
if (dev)
goto found;
dev = pci_get_class(PCI_CLASS_BRIDGE_ISA << 8, NULL);
if (dev)
goto found;
return 0;
found:
pci_dev_put(dev);
return 1;
#elif defined(CONFIG_EISA) || defined(CONFIG_ISA)
return 1;
#else
return 0;
#endif
}

static __inline__ int ide_default_irq(unsigned long base)
{
switch (base) {
Expand All @@ -45,6 +74,8 @@ static __inline__ int ide_default_irq(unsigned long base)

static __inline__ unsigned long ide_default_io_base(int index)
{
if (!ide_probe_legacy())
return 0;
/*
* If PCI is present then it is not safe to poke around
* the other legacy IDE ports. Only 0x1f0 and 0x170 are
Expand Down

0 comments on commit 0ffdb28

Please sign in to comment.