Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 81127
b: refs/heads/master
c: 553aa76
h: refs/heads/master
i:
  81125: 8d00c37
  81123: 713a672
  81119: ac6bb28
v: v3
  • Loading branch information
Benjamin Herrenschmidt authored and Paul Mackerras committed Dec 20, 2007
1 parent 6d2fa8f commit 14ded0b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: be8cbcd8896670a01ead7a29e33ffe29604ed734
refs/heads/master: 553aa7659bc0e188348f64e978343ed984eb6e56
13 changes: 10 additions & 3 deletions trunk/arch/powerpc/kernel/pci-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -1034,7 +1034,7 @@ static void __init pcibios_allocate_bus_resources(struct list_head *bus_list)
}
}

static inline void __devinit alloc_resource(struct pci_dev *dev, int idx)
static inline int __devinit alloc_resource(struct pci_dev *dev, int idx)
{
struct resource *pr, *r = &dev->resource[idx];

Expand All @@ -1058,7 +1058,10 @@ static inline void __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 @@ -1080,8 +1083,12 @@ 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);
if (pass == disabled && alloc_resource(dev, idx)) {
command &= ~(r->flags & (IORESOURCE_IO |
IORESOURCE_MEM));
pci_write_config_word(dev,
PCI_COMMAND, command);
}
}
if (pass)
continue;
Expand Down

0 comments on commit 14ded0b

Please sign in to comment.