Skip to content

Commit

Permalink
Revert "[POWERPC] Disable PCI IO/Mem on a device when resources can't…
Browse files Browse the repository at this point in the history
… be allocated"

This reverts commit 553aa76 at Ben H's
request, because it confused IORESOURCE_* flags with command register
bits.

Requested-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
  • Loading branch information
Paul Mackerras committed Dec 30, 2007
1 parent d2d8cfc commit 533b192
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions arch/powerpc/kernel/pci-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];

Expand All @@ -1059,10 +1059,7 @@ static inline int __devinit alloc_resource(struct pci_dev *dev, int idx)
r->flags |= IORESOURCE_UNSET;
r->end -= r->start;
r->start = 0;

return -EBUSY;
}
return 0;
}

static void __init pcibios_allocate_resources(int pass)
Expand All @@ -1084,12 +1081,8 @@ static void __init pcibios_allocate_resources(int pass)
disabled = !(command & PCI_COMMAND_IO);
else
disabled = !(command & PCI_COMMAND_MEMORY);
if (pass == disabled && alloc_resource(dev, idx)) {
command &= ~(r->flags & (IORESOURCE_IO |
IORESOURCE_MEM));
pci_write_config_word(dev,
PCI_COMMAND, command);
}
if (pass == disabled)
alloc_resource(dev, idx);
}
if (pass)
continue;
Expand Down

0 comments on commit 533b192

Please sign in to comment.