Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 39772038 authored by Yinghai Lu's avatar Yinghai Lu Committed by Bjorn Helgaas
Browse files

PCI: Assign resources for hot-added host bridge more aggressively



When hot-adding an ACPI host bridge, use
pci_assign_unassigned_root_bus_resources() instead of
pci_assign_unassigned_bus_resources().

The former is more aggressive and will release and reassign existing
resources if necessary.  This is safe at hot-add time because no drivers
are bound to devices below the new host bridge yet.

[bhelgaas: changelog, split __init changes out for reviewability]
Signed-off-by: default avatarYinghai Lu <yinghai@kernel.org>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
parent ff35147c
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -526,7 +526,7 @@ static int acpi_pci_root_add(struct acpi_device *device,


	if (system_state != SYSTEM_BOOTING) {
	if (system_state != SYSTEM_BOOTING) {
		pcibios_resource_survey_bus(root->bus);
		pcibios_resource_survey_bus(root->bus);
		pci_assign_unassigned_bus_resources(root->bus);
		pci_assign_unassigned_root_bus_resources(root->bus);
	}
	}


	pci_bus_add_devices(root->bus);
	pci_bus_add_devices(root->bus);
+1 −1
Original line number Original line Diff line number Diff line
@@ -1395,7 +1395,7 @@ static enum enable_type pci_realloc_detect(struct pci_bus *bus,
 * second  and later try will clear small leaf bridge res
 * second  and later try will clear small leaf bridge res
 * will stop till to the max  deepth if can not find good one
 * will stop till to the max  deepth if can not find good one
 */
 */
static void pci_assign_unassigned_root_bus_resources(struct pci_bus *bus)
void pci_assign_unassigned_root_bus_resources(struct pci_bus *bus)
{
{
	LIST_HEAD(realloc_head); /* list of resources that
	LIST_HEAD(realloc_head); /* list of resources that
					want additional resources */
					want additional resources */
+1 −0
Original line number Original line Diff line number Diff line
@@ -1003,6 +1003,7 @@ int pci_claim_resource(struct pci_dev *, int);
void pci_assign_unassigned_resources(void);
void pci_assign_unassigned_resources(void);
void pci_assign_unassigned_bridge_resources(struct pci_dev *bridge);
void pci_assign_unassigned_bridge_resources(struct pci_dev *bridge);
void pci_assign_unassigned_bus_resources(struct pci_bus *bus);
void pci_assign_unassigned_bus_resources(struct pci_bus *bus);
void pci_assign_unassigned_root_bus_resources(struct pci_bus *bus);
void pdev_enable_device(struct pci_dev *);
void pdev_enable_device(struct pci_dev *);
int pci_enable_resources(struct pci_dev *, int mask);
int pci_enable_resources(struct pci_dev *, int mask);
void pci_fixup_irqs(u8 (*)(struct pci_dev *, u8 *),
void pci_fixup_irqs(u8 (*)(struct pci_dev *, u8 *),