Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 362887
b: refs/heads/master
c: 139f925
h: refs/heads/master
i:
  362885: 965a718
  362883: 0b63ef0
  362879: 14cfcf7
v: v3
  • Loading branch information
Andy Shevchenko authored and Bjorn Helgaas committed Apr 12, 2013
1 parent 21270d1 commit c316300
Show file tree
Hide file tree
Showing 36 changed files with 722 additions and 452 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: a3b6bbd5774c13dab89d72f79976ba762913b2f2
refs/heads/master: 139f925126cc31b925484b2bc2cd0b0357c2bbd6
11 changes: 0 additions & 11 deletions trunk/arch/ia64/pci/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/pci.h>
#include <linux/pci-acpi.h>
#include <linux/init.h>
#include <linux/ioport.h>
#include <linux/slab.h>
Expand Down Expand Up @@ -459,16 +458,6 @@ void pcibios_fixup_bus(struct pci_bus *b)
platform_pci_fixup_bus(b);
}

void pcibios_add_bus(struct pci_bus *bus)
{
acpi_pci_add_bus(bus);
}

void pcibios_remove_bus(struct pci_bus *bus)
{
acpi_pci_remove_bus(bus);
}

void pcibios_set_master (struct pci_dev *dev)
{
/* No special bus mastering setup handling */
Expand Down
8 changes: 1 addition & 7 deletions trunk/arch/mips/pci/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ static void pcibios_scanbus(struct pci_controller *hose)
pci_bus_assign_resources(bus);
pci_enable_bridges(bus);
}
bus->dev.of_node = hose->of_node;
}
}

Expand Down Expand Up @@ -168,13 +169,6 @@ void pci_load_of_ranges(struct pci_controller *hose, struct device_node *node)
}
}
}

struct device_node *pcibios_get_phb_of_node(struct pci_bus *bus)
{
struct pci_controller *hose = bus->sysdata;

return of_node_get(hose->of_node);
}
#endif

static DEFINE_MUTEX(pci_scan_mutex);
Expand Down
11 changes: 0 additions & 11 deletions trunk/arch/x86/pci/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

#include <linux/sched.h>
#include <linux/pci.h>
#include <linux/pci-acpi.h>
#include <linux/ioport.h>
#include <linux/init.h>
#include <linux/dmi.h>
Expand Down Expand Up @@ -171,16 +170,6 @@ void pcibios_fixup_bus(struct pci_bus *b)
pcibios_fixup_device_resources(dev);
}

void pcibios_add_bus(struct pci_bus *bus)
{
acpi_pci_add_bus(bus);
}

void pcibios_remove_bus(struct pci_bus *bus)
{
acpi_pci_remove_bus(bus);
}

/*
* Only use DMI information to set this if nothing was passed
* on the kernel command line (which was parsed earlier).
Expand Down
48 changes: 47 additions & 1 deletion trunk/drivers/acpi/pci_root.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,44 @@ static struct acpi_scan_handler pci_root_handler = {
.detach = acpi_pci_root_remove,
};

/* Lock to protect both acpi_pci_roots lists */
/* Lock to protect both acpi_pci_roots and acpi_pci_drivers lists */
static DEFINE_MUTEX(acpi_pci_root_lock);
static LIST_HEAD(acpi_pci_roots);
static LIST_HEAD(acpi_pci_drivers);

static DEFINE_MUTEX(osc_lock);

int acpi_pci_register_driver(struct acpi_pci_driver *driver)
{
int n = 0;
struct acpi_pci_root *root;

mutex_lock(&acpi_pci_root_lock);
list_add_tail(&driver->node, &acpi_pci_drivers);
if (driver->add)
list_for_each_entry(root, &acpi_pci_roots, node) {
driver->add(root);
n++;
}
mutex_unlock(&acpi_pci_root_lock);

return n;
}
EXPORT_SYMBOL(acpi_pci_register_driver);

void acpi_pci_unregister_driver(struct acpi_pci_driver *driver)
{
struct acpi_pci_root *root;

mutex_lock(&acpi_pci_root_lock);
list_del(&driver->node);
if (driver->remove)
list_for_each_entry(root, &acpi_pci_roots, node)
driver->remove(root);
mutex_unlock(&acpi_pci_root_lock);
}
EXPORT_SYMBOL(acpi_pci_unregister_driver);

/**
* acpi_is_root_bridge - determine whether an ACPI CA node is a PCI root bridge
* @handle - the ACPI CA node in question.
Expand Down Expand Up @@ -381,6 +413,7 @@ static int acpi_pci_root_add(struct acpi_device *device,
acpi_status status;
int result;
struct acpi_pci_root *root;
struct acpi_pci_driver *driver;
u32 flags, base_flags;
bool is_osc_granted = false;

Expand Down Expand Up @@ -540,6 +573,12 @@ static int acpi_pci_root_add(struct acpi_device *device,
pci_assign_unassigned_bus_resources(root->bus);
}

mutex_lock(&acpi_pci_root_lock);
list_for_each_entry(driver, &acpi_pci_drivers, node)
if (driver->add)
driver->add(root);
mutex_unlock(&acpi_pci_root_lock);

/* need to after hot-added ioapic is registered */
if (system_state != SYSTEM_BOOTING)
pci_enable_bridges(root->bus);
Expand All @@ -560,9 +599,16 @@ static int acpi_pci_root_add(struct acpi_device *device,
static void acpi_pci_root_remove(struct acpi_device *device)
{
struct acpi_pci_root *root = acpi_driver_data(device);
struct acpi_pci_driver *driver;

pci_stop_root_bus(root->bus);

mutex_lock(&acpi_pci_root_lock);
list_for_each_entry_reverse(driver, &acpi_pci_drivers, node)
if (driver->remove)
driver->remove(root);
mutex_unlock(&acpi_pci_root_lock);

device_set_run_wake(root->bus->bridge, false);
pci_acpi_remove_bus_pm_notifier(device);

Expand Down
Loading

0 comments on commit c316300

Please sign in to comment.