Merge branch 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6
* 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6: (48 commits) x86/PCI: Prevent mmconfig memory corruption ACPI: Use GPE reference counting to support shared GPEs x86/PCI: use host bridge _CRS info by default on 2008 and newer machines PCI: augment bus resource table with a list PCI: add pci_bus_for_each_resource(), remove direct bus->resource[] refs PCI: read bridge windows before filling in subtractive decode resources PCI: split up pci_read_bridge_bases() PCIe PME: use pci_pcie_cap() PCI PM: Run-time callbacks for PCI bus type PCIe PME: use pci_is_pcie() PCI / ACPI / PM: Platform support for PCI PME wake-up ACPI / ACPICA: Multiple system notify handlers per device ACPI / PM: Add more run-time wake-up fields ACPI: Use GPE reference counting to support shared GPEs PCI PM: Make it possible to force using INTx for PCIe PME signaling PCI PM: PCIe PME root port service driver PCI PM: Add function for checking PME status of devices PCI: mark is_pcie obsolete PCI: set PCI_PREF_RANGE_TYPE_64 in pci_bridge_check_ranges PCI: pciehp: second try to get big range for pcie devices ...
This commit is contained in:
@ -222,3 +222,8 @@ config PM_RUNTIME
|
||||
and the bus type drivers of the buses the devices are on are
|
||||
responsible for the actual handling of the autosuspend requests and
|
||||
wake-up events.
|
||||
|
||||
config PM_OPS
|
||||
bool
|
||||
depends on PM_SLEEP || PM_RUNTIME
|
||||
default y
|
||||
|
@ -188,6 +188,36 @@ static int __release_resource(struct resource *old)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
static void __release_child_resources(struct resource *r)
|
||||
{
|
||||
struct resource *tmp, *p;
|
||||
resource_size_t size;
|
||||
|
||||
p = r->child;
|
||||
r->child = NULL;
|
||||
while (p) {
|
||||
tmp = p;
|
||||
p = p->sibling;
|
||||
|
||||
tmp->parent = NULL;
|
||||
tmp->sibling = NULL;
|
||||
__release_child_resources(tmp);
|
||||
|
||||
printk(KERN_DEBUG "release child resource %pR\n", tmp);
|
||||
/* need to restore size, and keep flags */
|
||||
size = resource_size(tmp);
|
||||
tmp->start = 0;
|
||||
tmp->end = size - 1;
|
||||
}
|
||||
}
|
||||
|
||||
void release_child_resources(struct resource *r)
|
||||
{
|
||||
write_lock(&resource_lock);
|
||||
__release_child_resources(r);
|
||||
write_unlock(&resource_lock);
|
||||
}
|
||||
|
||||
/**
|
||||
* request_resource - request and reserve an I/O or memory resource
|
||||
* @root: root resource descriptor
|
||||
@ -303,8 +333,10 @@ int walk_system_ram_range(unsigned long start_pfn, unsigned long nr_pages,
|
||||
static int find_resource(struct resource *root, struct resource *new,
|
||||
resource_size_t size, resource_size_t min,
|
||||
resource_size_t max, resource_size_t align,
|
||||
void (*alignf)(void *, struct resource *,
|
||||
resource_size_t, resource_size_t),
|
||||
resource_size_t (*alignf)(void *,
|
||||
const struct resource *,
|
||||
resource_size_t,
|
||||
resource_size_t),
|
||||
void *alignf_data)
|
||||
{
|
||||
struct resource *this = root->child;
|
||||
@ -330,7 +362,7 @@ static int find_resource(struct resource *root, struct resource *new,
|
||||
tmp.end = max;
|
||||
tmp.start = ALIGN(tmp.start, align);
|
||||
if (alignf)
|
||||
alignf(alignf_data, &tmp, size, align);
|
||||
tmp.start = alignf(alignf_data, &tmp, size, align);
|
||||
if (tmp.start < tmp.end && tmp.end - tmp.start >= size - 1) {
|
||||
new->start = tmp.start;
|
||||
new->end = tmp.start + size - 1;
|
||||
@ -358,8 +390,10 @@ static int find_resource(struct resource *root, struct resource *new,
|
||||
int allocate_resource(struct resource *root, struct resource *new,
|
||||
resource_size_t size, resource_size_t min,
|
||||
resource_size_t max, resource_size_t align,
|
||||
void (*alignf)(void *, struct resource *,
|
||||
resource_size_t, resource_size_t),
|
||||
resource_size_t (*alignf)(void *,
|
||||
const struct resource *,
|
||||
resource_size_t,
|
||||
resource_size_t),
|
||||
void *alignf_data)
|
||||
{
|
||||
int err;
|
||||
|
Reference in New Issue
Block a user