Commit 533b1928 authored by Paul Mackerras's avatar Paul Mackerras

Revert "[POWERPC] Disable PCI IO/Mem on a device when resources can't be allocated"

This reverts commit 553aa765 at Ben H's
request, because it confused IORESOURCE_* flags with command register
bits.
Requested-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent d2d8cfc6
...@@ -1035,7 +1035,7 @@ static void __init pcibios_allocate_bus_resources(struct list_head *bus_list) ...@@ -1035,7 +1035,7 @@ static void __init pcibios_allocate_bus_resources(struct list_head *bus_list)
} }
} }
static inline int __devinit alloc_resource(struct pci_dev *dev, int idx) static inline void __devinit alloc_resource(struct pci_dev *dev, int idx)
{ {
struct resource *pr, *r = &dev->resource[idx]; struct resource *pr, *r = &dev->resource[idx];
...@@ -1059,10 +1059,7 @@ static inline int __devinit alloc_resource(struct pci_dev *dev, int idx) ...@@ -1059,10 +1059,7 @@ static inline int __devinit alloc_resource(struct pci_dev *dev, int idx)
r->flags |= IORESOURCE_UNSET; r->flags |= IORESOURCE_UNSET;
r->end -= r->start; r->end -= r->start;
r->start = 0; r->start = 0;
return -EBUSY;
} }
return 0;
} }
static void __init pcibios_allocate_resources(int pass) static void __init pcibios_allocate_resources(int pass)
...@@ -1084,12 +1081,8 @@ static void __init pcibios_allocate_resources(int pass) ...@@ -1084,12 +1081,8 @@ static void __init pcibios_allocate_resources(int pass)
disabled = !(command & PCI_COMMAND_IO); disabled = !(command & PCI_COMMAND_IO);
else else
disabled = !(command & PCI_COMMAND_MEMORY); disabled = !(command & PCI_COMMAND_MEMORY);
if (pass == disabled && alloc_resource(dev, idx)) { if (pass == disabled)
command &= ~(r->flags & (IORESOURCE_IO | alloc_resource(dev, idx);
IORESOURCE_MEM));
pci_write_config_word(dev,
PCI_COMMAND, command);
}
} }
if (pass) if (pass)
continue; continue;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment