Skip to content

Commit

Permalink
x86/PCI: Implement pcibios_resource_survey_bus()
Browse files Browse the repository at this point in the history
During testing remove/rescan root bus 00, found
[  338.142574] bus: 'pci': really_probe: probing driver ata_piix with device 0000:00:01.1
[  338.146788] ata_piix 0000:00:01.1: device not available (can't reserve [io  0x01f0-0x01f7])
[  338.150565] ata_piix: probe of 0000:00:01.1 failed with error -22

because that fixed resource is not claimed.
For bootint path it is claimed in  from
        arch/x86/pci/i386.c::pcibios_allocate_resources()

Claim those resources, so on the remove/rescan will still use old
resources.

It is some kind honoring FW setting in the registers during hot add.
esp root-bus hot add is through acpi, BIOS has chance to set some registers
before handing over.

[bhelgaas: move weak definition to patch that uses it]
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
  • Loading branch information
Yinghai Lu authored and Bjorn Helgaas committed Jan 7, 2013
1 parent 3c449ed commit b3e65e1
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions arch/x86/pci/i386.c
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,19 @@ static int __init pcibios_assign_resources(void)
return 0;
}

void pcibios_resource_survey_bus(struct pci_bus *bus)
{
dev_printk(KERN_DEBUG, &bus->dev, "Allocating resources\n");

pcibios_allocate_bus_resources(bus);

pcibios_allocate_resources(bus, 0);
pcibios_allocate_resources(bus, 1);

if (!(pci_probe & PCI_ASSIGN_ROMS))
pcibios_allocate_rom_resources(bus);
}

void __init pcibios_resource_survey(void)
{
struct pci_bus *bus;
Expand Down

0 comments on commit b3e65e1

Please sign in to comment.