Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 358388
b: refs/heads/master
c: dc2f56f
h: refs/heads/master
v: v3
  • Loading branch information
Yinghai Lu authored and Bjorn Helgaas committed Jan 7, 2013
1 parent cf230fd commit 786d2fe
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 18 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: 83edc87ce8b284a3d60ab8072e55041c76a68277
refs/heads/master: dc2f56fa8400677ef4852d5128f03b795cf57e7b
52 changes: 35 additions & 17 deletions trunk/arch/x86/pci/i386.c
Original file line number Diff line number Diff line change
Expand Up @@ -298,27 +298,45 @@ static void __init pcibios_allocate_resources(struct pci_bus *bus, int pass)
}
}

static int __init pcibios_assign_resources(void)
static void __init pcibios_allocate_dev_rom_resource(struct pci_dev *dev)
{
struct pci_dev *dev = NULL;
struct resource *r;

if (!(pci_probe & PCI_ASSIGN_ROMS)) {
/*
* Try to use BIOS settings for ROMs, otherwise let
* pci_assign_unassigned_resources() allocate the new
* addresses.
*/
for_each_pci_dev(dev) {
r = &dev->resource[PCI_ROM_RESOURCE];
if (!r->flags || !r->start)
continue;
if (pci_claim_resource(dev, PCI_ROM_RESOURCE) < 0) {
r->end -= r->start;
r->start = 0;
}
}
/*
* Try to use BIOS settings for ROMs, otherwise let
* pci_assign_unassigned_resources() allocate the new
* addresses.
*/
r = &dev->resource[PCI_ROM_RESOURCE];
if (!r->flags || !r->start)
return;

if (pci_claim_resource(dev, PCI_ROM_RESOURCE) < 0) {
r->end -= r->start;
r->start = 0;
}
}
static void __init pcibios_allocate_rom_resources(struct pci_bus *bus)
{
struct pci_dev *dev;
struct pci_bus *child;

list_for_each_entry(dev, &bus->devices, bus_list) {
pcibios_allocate_dev_rom_resource(dev);

child = dev->subordinate;
if (child)
pcibios_allocate_rom_resources(child);
}
}

static int __init pcibios_assign_resources(void)
{
struct pci_bus *bus;

if (!(pci_probe & PCI_ASSIGN_ROMS))
list_for_each_entry(bus, &pci_root_buses, node)
pcibios_allocate_rom_resources(bus);

pci_assign_unassigned_resources();
pcibios_fw_addr_list_del();
Expand Down

0 comments on commit 786d2fe

Please sign in to comment.