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

Commit 8d666e53 authored by Bjorn Helgaas's avatar Bjorn Helgaas
Browse files

Merge branch 'pci/hotplug' into next

* pci/hotplug:
  PCI: pciehp: Do not clear Presence Detect Changed during initialization
  PCI: pciehp: Fix race condition handling surprise link down
  PCI: Distribute available resources to hotplug-capable bridges
  PCI: Distribute available buses to hotplug-capable bridges
  PCI: Do not allocate more buses than available in parent
  PCI: Open-code the two pass loop when scanning bridges
  PCI: Move pci_hp_add_bridge() to drivers/pci/probe.c
  PCI: Add for_each_pci_bridge() helper
  PCI: shpchp: Convert timers to use timer_setup()
  PCI: cpqphp: Convert timers to use timer_setup()
  PCI: pciehp: Convert timers to use timer_setup()
  PCI: ibmphp: Use common error handling code in unconfigure_boot_device()
parents 1a03bac3 db63d400
Loading
Loading
Loading
Loading
+0 −3
Original line number Original line Diff line number Diff line
@@ -16,9 +16,6 @@ obj-$(CONFIG_PCIEPORTBUS) += pcie/


# Build the PCI Hotplug drivers if we were asked to
# Build the PCI Hotplug drivers if we were asked to
obj-$(CONFIG_HOTPLUG_PCI) += hotplug/
obj-$(CONFIG_HOTPLUG_PCI) += hotplug/
ifdef CONFIG_HOTPLUG_PCI
obj-y += hotplug-pci.o
endif


# Build the PCI MSI interrupt support
# Build the PCI MSI interrupt support
obj-$(CONFIG_PCI_MSI) += msi.o
obj-$(CONFIG_PCI_MSI) += msi.o

drivers/pci/hotplug-pci.c

deleted100644 → 0
+0 −29
Original line number Original line Diff line number Diff line
/* Core PCI functionality used only by PCI hotplug */

#include <linux/pci.h>
#include <linux/export.h>
#include "pci.h"

int pci_hp_add_bridge(struct pci_dev *dev)
{
	struct pci_bus *parent = dev->bus;
	int pass, busnr, start = parent->busn_res.start;
	int end = parent->busn_res.end;

	for (busnr = start; busnr <= end; busnr++) {
		if (!pci_find_bus(pci_domain_nr(parent), busnr))
			break;
	}
	if (busnr-- > end) {
		printk(KERN_ERR "No bus number available for hot-added bridge %s\n",
				pci_name(dev));
		return -1;
	}
	for (pass = 0; pass < 2; pass++)
		busnr = pci_scan_bridge(parent, dev, busnr, pass);
	if (!dev->subordinate)
		return -1;

	return 0;
}
EXPORT_SYMBOL_GPL(pci_hp_add_bridge);
+6 −9
Original line number Original line Diff line number Diff line
@@ -462,18 +462,15 @@ static void enable_slot(struct acpiphp_slot *slot)
	acpiphp_rescan_slot(slot);
	acpiphp_rescan_slot(slot);
	max = acpiphp_max_busnr(bus);
	max = acpiphp_max_busnr(bus);
	for (pass = 0; pass < 2; pass++) {
	for (pass = 0; pass < 2; pass++) {
		list_for_each_entry(dev, &bus->devices, bus_list) {
		for_each_pci_bridge(dev, bus) {
			if (PCI_SLOT(dev->devfn) != slot->device)
			if (PCI_SLOT(dev->devfn) != slot->device)
				continue;
				continue;


			if (pci_is_bridge(dev)) {
			max = pci_scan_bridge(bus, dev, max, pass);
			max = pci_scan_bridge(bus, dev, max, pass);
			if (pass && dev->subordinate) {
			if (pass && dev->subordinate) {
				check_hotplug_bridge(slot, dev);
				check_hotplug_bridge(slot, dev);
				pcibios_resource_survey_bus(dev->subordinate);
				pcibios_resource_survey_bus(dev->subordinate);
					__pci_bus_size_bridges(dev->subordinate,
				__pci_bus_size_bridges(dev->subordinate, &add_list);
							       &add_list);
				}
			}
			}
		}
		}
	}
	}
+2 −5
Original line number Original line Diff line number Diff line
@@ -286,14 +286,11 @@ int cpci_configure_slot(struct slot *slot)
	}
	}
	parent = slot->dev->bus;
	parent = slot->dev->bus;


	list_for_each_entry(dev, &parent->devices, bus_list) {
	for_each_pci_bridge(dev, parent) {
		if (PCI_SLOT(dev->devfn) != PCI_SLOT(slot->devfn))
		if (PCI_SLOT(dev->devfn) == PCI_SLOT(slot->devfn))
			continue;
		if (pci_is_bridge(dev))
			pci_hp_add_bridge(dev);
			pci_hp_add_bridge(dev);
	}
	}



	pci_assign_unassigned_bridge_resources(parent->self);
	pci_assign_unassigned_bridge_resources(parent->self);


	pci_bus_add_devices(parent);
	pci_bus_add_devices(parent);
+1 −1
Original line number Original line Diff line number Diff line
@@ -410,7 +410,7 @@ void cpqhp_create_debugfs_files(struct controller *ctrl);
void cpqhp_remove_debugfs_files(struct controller *ctrl);
void cpqhp_remove_debugfs_files(struct controller *ctrl);


/* controller functions */
/* controller functions */
void cpqhp_pushbutton_thread(unsigned long event_pointer);
void cpqhp_pushbutton_thread(struct timer_list *t);
irqreturn_t cpqhp_ctrl_intr(int IRQ, void *data);
irqreturn_t cpqhp_ctrl_intr(int IRQ, void *data);
int cpqhp_find_available_resources(struct controller *ctrl,
int cpqhp_find_available_resources(struct controller *ctrl,
				   void __iomem *rom_start);
				   void __iomem *rom_start);
Loading