aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-02-10 18:09:41 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2015-02-10 18:09:41 -0500
commit872912352c5be930e9568e5f3b6d73107d9f278d (patch)
treeecc18608e200307588ac5130774518a54a292756 /drivers/pci
parentc08f8467939e7d2eebcba7cf2330242c4f53f2f7 (diff)
parentb5e82233cab43c25fc0a1c28d9136a086db4aa52 (diff)
Merge tag 'pm+acpi-3.20-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull ACPI and power management updates from Rafael Wysocki: "We have a few new features this time, including a new SFI-based cpufreq driver, a new devfreq driver for Tegra Activity Monitor, a new devfreq class for providing its governors with raw utilization data and a new ACPI driver for AMD SoCs. Still, the majority of changes here are reworks of existing code to make it more straightforward or to prepare it for implementing new features on top of it. The primary example is the rework of ACPI resources handling from Jiang Liu, Thomas Gleixner and Lv Zheng with support for IOAPIC hotplug implemented on top of it, but there is quite a number of changes of this kind in the cpufreq core, ACPICA, ACPI EC driver, ACPI processor driver and the generic power domains core code too. The most active developer is Viresh Kumar with his cpufreq changes. Specifics: - Rework of the core ACPI resources parsing code to fix issues in it and make using resource offsets more convenient and consolidation of some resource-handing code in a couple of places that have grown analagous data structures and code to cover the the same gap in the core (Jiang Liu, Thomas Gleixner, Lv Zheng). - ACPI-based IOAPIC hotplug support on top of the resources handling rework (Jiang Liu, Yinghai Lu). - ACPICA update to upstream release 20150204 including an interrupt handling rework that allows drivers to install raw handlers for ACPI GPEs which then become entirely responsible for the given GPE and the ACPICA core code won't touch it (Lv Zheng, David E Box, Octavian Purdila). - ACPI EC driver rework to fix several concurrency issues and other problems related to events handling on top of the ACPICA's new support for raw GPE handlers (Lv Zheng). - New ACPI driver for AMD SoCs analogous to the LPSS (Low-Power Subsystem) driver for Intel chips (Ken Xue). - Two minor fixes of the ACPI LPSS driver (Heikki Krogerus, Jarkko Nikula). - Two new blacklist entries for machines (Samsung 730U3E/740U3E and 510R) where the native backlight interface doesn't work correctly while the ACPI one does (Hans de Goede). - Rework of the ACPI processor driver's handling of idle states to make the code more straightforward and less bloated overall (Rafael J Wysocki). - Assorted minor fixes related to ACPI and SFI (Andreas Ruprecht, Andy Shevchenko, Hanjun Guo, Jan Beulich, Rafael J Wysocki, Yaowei Bai). - PCI core power management modification to avoid resuming (some) runtime-suspended devices during system suspend if they are in the right states already (Rafael J Wysocki). - New SFI-based cpufreq driver for Intel platforms using SFI (Srinidhi Kasagar). - cpufreq core fixes, cleanups and simplifications (Viresh Kumar, Doug Anderson, Wolfram Sang). - SkyLake CPU support and other updates for the intel_pstate driver (Kristen Carlson Accardi, Srinivas Pandruvada). - cpufreq-dt driver cleanup (Markus Elfring). - Init fix for the ARM big.LITTLE cpuidle driver (Sudeep Holla). - Generic power domains core code fixes and cleanups (Ulf Hansson). - Operating Performance Points (OPP) core code cleanups and kernel documentation update (Nishanth Menon). - New dabugfs interface to make the list of PM QoS constraints available to user space (Nishanth Menon). - New devfreq driver for Tegra Activity Monitor (Tomeu Vizoso). - New devfreq class (devfreq_event) to provide raw utilization data to devfreq governors (Chanwoo Choi). - Assorted minor fixes and cleanups related to power management (Andreas Ruprecht, Krzysztof Kozlowski, Rickard Strandqvist, Pavel Machek, Todd E Brandt, Wonhong Kwon). - turbostat updates (Len Brown) and cpupower Makefile improvement (Sriram Raghunathan)" * tag 'pm+acpi-3.20-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (151 commits) tools/power turbostat: relax dependency on APERF_MSR tools/power turbostat: relax dependency on invariant TSC Merge branch 'pci/host-generic' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci into acpi-resources tools/power turbostat: decode MSR_*_PERF_LIMIT_REASONS tools/power turbostat: relax dependency on root permission ACPI / video: Add disable_native_backlight quirk for Samsung 510R ACPI / PM: Remove unneeded nested #ifdef USB / PM: Remove unneeded #ifdef and associated dead code intel_pstate: provide option to only use intel_pstate with HWP ACPI / EC: Add GPE reference counting debugging messages ACPI / EC: Add query flushing support ACPI / EC: Refine command storm prevention support ACPI / EC: Add command flushing support. ACPI / EC: Introduce STARTED/STOPPED flags to replace BLOCKED flag ACPI: add AMD ACPI2Platform device support for x86 system ACPI / table: remove duplicate NULL check for the handler of acpi_table_parse() ACPI / EC: Update revision due to raw handler mode. ACPI / EC: Reduce ec_poll() by referencing the last register access timestamp. ACPI / EC: Fix several GPE handling issues by deploying ACPI_GPE_DISPATCH_RAW_HANDLER mode. ACPICA: Events: Enable APIs to allow interrupt/polling adaptive request based GPE handling model ...
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/bus.c18
-rw-r--r--drivers/pci/host-bridge.c8
-rw-r--r--drivers/pci/host/pci-host-generic.c4
-rw-r--r--drivers/pci/host/pci-versatile.c4
-rw-r--r--drivers/pci/host/pci-xgene.c4
-rw-r--r--drivers/pci/host/pcie-xilinx.c4
-rw-r--r--drivers/pci/hotplug/sgi_hotplug.c13
-rw-r--r--drivers/pci/pci-acpi.c17
-rw-r--r--drivers/pci/pci-driver.c11
-rw-r--r--drivers/pci/pci.c26
-rw-r--r--drivers/pci/pci.h6
-rw-r--r--drivers/pci/probe.c10
12 files changed, 85 insertions, 40 deletions
diff --git a/drivers/pci/bus.c b/drivers/pci/bus.c
index 8fb16188cd82..90fa3a78fb7c 100644
--- a/drivers/pci/bus.c
+++ b/drivers/pci/bus.c
@@ -20,17 +20,16 @@
20void pci_add_resource_offset(struct list_head *resources, struct resource *res, 20void pci_add_resource_offset(struct list_head *resources, struct resource *res,
21 resource_size_t offset) 21 resource_size_t offset)
22{ 22{
23 struct pci_host_bridge_window *window; 23 struct resource_entry *entry;
24 24
25 window = kzalloc(sizeof(struct pci_host_bridge_window), GFP_KERNEL); 25 entry = resource_list_create_entry(res, 0);
26 if (!window) { 26 if (!entry) {
27 printk(KERN_ERR "PCI: can't add host bridge window %pR\n", res); 27 printk(KERN_ERR "PCI: can't add host bridge window %pR\n", res);
28 return; 28 return;
29 } 29 }
30 30
31 window->res = res; 31 entry->offset = offset;
32 window->offset = offset; 32 resource_list_add_tail(entry, resources);
33 list_add_tail(&window->list, resources);
34} 33}
35EXPORT_SYMBOL(pci_add_resource_offset); 34EXPORT_SYMBOL(pci_add_resource_offset);
36 35
@@ -42,12 +41,7 @@ EXPORT_SYMBOL(pci_add_resource);
42 41
43void pci_free_resource_list(struct list_head *resources) 42void pci_free_resource_list(struct list_head *resources)
44{ 43{
45 struct pci_host_bridge_window *window, *tmp; 44 resource_list_free(resources);
46
47 list_for_each_entry_safe(window, tmp, resources, list) {
48 list_del(&window->list);
49 kfree(window);
50 }
51} 45}
52EXPORT_SYMBOL(pci_free_resource_list); 46EXPORT_SYMBOL(pci_free_resource_list);
53 47
diff --git a/drivers/pci/host-bridge.c b/drivers/pci/host-bridge.c
index 0e5f3c95af5b..39b2dbe585aa 100644
--- a/drivers/pci/host-bridge.c
+++ b/drivers/pci/host-bridge.c
@@ -35,10 +35,10 @@ void pcibios_resource_to_bus(struct pci_bus *bus, struct pci_bus_region *region,
35 struct resource *res) 35 struct resource *res)
36{ 36{
37 struct pci_host_bridge *bridge = find_pci_host_bridge(bus); 37 struct pci_host_bridge *bridge = find_pci_host_bridge(bus);
38 struct pci_host_bridge_window *window; 38 struct resource_entry *window;
39 resource_size_t offset = 0; 39 resource_size_t offset = 0;
40 40
41 list_for_each_entry(window, &bridge->windows, list) { 41 resource_list_for_each_entry(window, &bridge->windows) {
42 if (resource_contains(window->res, res)) { 42 if (resource_contains(window->res, res)) {
43 offset = window->offset; 43 offset = window->offset;
44 break; 44 break;
@@ -60,10 +60,10 @@ void pcibios_bus_to_resource(struct pci_bus *bus, struct resource *res,
60 struct pci_bus_region *region) 60 struct pci_bus_region *region)
61{ 61{
62 struct pci_host_bridge *bridge = find_pci_host_bridge(bus); 62 struct pci_host_bridge *bridge = find_pci_host_bridge(bus);
63 struct pci_host_bridge_window *window; 63 struct resource_entry *window;
64 resource_size_t offset = 0; 64 resource_size_t offset = 0;
65 65
66 list_for_each_entry(window, &bridge->windows, list) { 66 resource_list_for_each_entry(window, &bridge->windows) {
67 struct pci_bus_region bus_region; 67 struct pci_bus_region bus_region;
68 68
69 if (resource_type(res) != resource_type(window->res)) 69 if (resource_type(res) != resource_type(window->res))
diff --git a/drivers/pci/host/pci-host-generic.c b/drivers/pci/host/pci-host-generic.c
index 925e29e3d4c8..ba46e581db99 100644
--- a/drivers/pci/host/pci-host-generic.c
+++ b/drivers/pci/host/pci-host-generic.c
@@ -103,14 +103,14 @@ static int gen_pci_parse_request_of_pci_ranges(struct gen_pci *pci)
103 struct device *dev = pci->host.dev.parent; 103 struct device *dev = pci->host.dev.parent;
104 struct device_node *np = dev->of_node; 104 struct device_node *np = dev->of_node;
105 resource_size_t iobase; 105 resource_size_t iobase;
106 struct pci_host_bridge_window *win; 106 struct resource_entry *win;
107 107
108 err = of_pci_get_host_bridge_resources(np, 0, 0xff, &pci->resources, 108 err = of_pci_get_host_bridge_resources(np, 0, 0xff, &pci->resources,
109 &iobase); 109 &iobase);
110 if (err) 110 if (err)
111 return err; 111 return err;
112 112
113 list_for_each_entry(win, &pci->resources, list) { 113 resource_list_for_each_entry(win, &pci->resources) {
114 struct resource *parent, *res = win->res; 114 struct resource *parent, *res = win->res;
115 115
116 switch (resource_type(res)) { 116 switch (resource_type(res)) {
diff --git a/drivers/pci/host/pci-versatile.c b/drivers/pci/host/pci-versatile.c
index 341529ca23e8..1ec694a52379 100644
--- a/drivers/pci/host/pci-versatile.c
+++ b/drivers/pci/host/pci-versatile.c
@@ -74,13 +74,13 @@ static int versatile_pci_parse_request_of_pci_ranges(struct device *dev,
74 int err, mem = 1, res_valid = 0; 74 int err, mem = 1, res_valid = 0;
75 struct device_node *np = dev->of_node; 75 struct device_node *np = dev->of_node;
76 resource_size_t iobase; 76 resource_size_t iobase;
77 struct pci_host_bridge_window *win; 77 struct resource_entry *win;
78 78
79 err = of_pci_get_host_bridge_resources(np, 0, 0xff, res, &iobase); 79 err = of_pci_get_host_bridge_resources(np, 0, 0xff, res, &iobase);
80 if (err) 80 if (err)
81 return err; 81 return err;
82 82
83 list_for_each_entry(win, res, list) { 83 resource_list_for_each_entry(win, res, list) {
84 struct resource *parent, *res = win->res; 84 struct resource *parent, *res = win->res;
85 85
86 switch (resource_type(res)) { 86 switch (resource_type(res)) {
diff --git a/drivers/pci/host/pci-xgene.c b/drivers/pci/host/pci-xgene.c
index e77d831dc241..aab55474dd0d 100644
--- a/drivers/pci/host/pci-xgene.c
+++ b/drivers/pci/host/pci-xgene.c
@@ -269,11 +269,11 @@ static int xgene_pcie_map_ranges(struct xgene_pcie_port *port,
269 struct list_head *res, 269 struct list_head *res,
270 resource_size_t io_base) 270 resource_size_t io_base)
271{ 271{
272 struct pci_host_bridge_window *window; 272 struct resource_entry *window;
273 struct device *dev = port->dev; 273 struct device *dev = port->dev;
274 int ret; 274 int ret;
275 275
276 list_for_each_entry(window, res, list) { 276 resource_list_for_each_entry(window, res) {
277 struct resource *res = window->res; 277 struct resource *res = window->res;
278 u64 restype = resource_type(res); 278 u64 restype = resource_type(res);
279 279
diff --git a/drivers/pci/host/pcie-xilinx.c b/drivers/pci/host/pcie-xilinx.c
index eac4a4b957ca..f1a06a091ccb 100644
--- a/drivers/pci/host/pcie-xilinx.c
+++ b/drivers/pci/host/pcie-xilinx.c
@@ -667,7 +667,7 @@ static int xilinx_pcie_parse_and_add_res(struct xilinx_pcie_port *port)
667 resource_size_t offset; 667 resource_size_t offset;
668 struct of_pci_range_parser parser; 668 struct of_pci_range_parser parser;
669 struct of_pci_range range; 669 struct of_pci_range range;
670 struct pci_host_bridge_window *win; 670 struct resource_entry *win;
671 int err = 0, mem_resno = 0; 671 int err = 0, mem_resno = 0;
672 672
673 /* Get the ranges */ 673 /* Get the ranges */
@@ -737,7 +737,7 @@ static int xilinx_pcie_parse_and_add_res(struct xilinx_pcie_port *port)
737 737
738free_resources: 738free_resources:
739 release_child_resources(&iomem_resource); 739 release_child_resources(&iomem_resource);
740 list_for_each_entry(win, &port->resources, list) 740 resource_list_for_each_entry(win, &port->resources)
741 devm_kfree(dev, win->res); 741 devm_kfree(dev, win->res);
742 pci_free_resource_list(&port->resources); 742 pci_free_resource_list(&port->resources);
743 743
diff --git a/drivers/pci/hotplug/sgi_hotplug.c b/drivers/pci/hotplug/sgi_hotplug.c
index bada20999870..c32fb786d48e 100644
--- a/drivers/pci/hotplug/sgi_hotplug.c
+++ b/drivers/pci/hotplug/sgi_hotplug.c
@@ -475,7 +475,7 @@ static int disable_slot(struct hotplug_slot *bss_hotplug_slot)
475 struct slot *slot = bss_hotplug_slot->private; 475 struct slot *slot = bss_hotplug_slot->private;
476 struct pci_dev *dev, *temp; 476 struct pci_dev *dev, *temp;
477 int rc; 477 int rc;
478 acpi_owner_id ssdt_id = 0; 478 acpi_handle ssdt_hdl = NULL;
479 479
480 /* Acquire update access to the bus */ 480 /* Acquire update access to the bus */
481 mutex_lock(&sn_hotplug_mutex); 481 mutex_lock(&sn_hotplug_mutex);
@@ -522,7 +522,7 @@ static int disable_slot(struct hotplug_slot *bss_hotplug_slot)
522 if (ACPI_SUCCESS(ret) && 522 if (ACPI_SUCCESS(ret) &&
523 (adr>>16) == (slot->device_num + 1)) { 523 (adr>>16) == (slot->device_num + 1)) {
524 /* retain the owner id */ 524 /* retain the owner id */
525 acpi_get_id(chandle, &ssdt_id); 525 ssdt_hdl = chandle;
526 526
527 ret = acpi_bus_get_device(chandle, 527 ret = acpi_bus_get_device(chandle,
528 &device); 528 &device);
@@ -547,12 +547,13 @@ static int disable_slot(struct hotplug_slot *bss_hotplug_slot)
547 pci_unlock_rescan_remove(); 547 pci_unlock_rescan_remove();
548 548
549 /* Remove the SSDT for the slot from the ACPI namespace */ 549 /* Remove the SSDT for the slot from the ACPI namespace */
550 if (SN_ACPI_BASE_SUPPORT() && ssdt_id) { 550 if (SN_ACPI_BASE_SUPPORT() && ssdt_hdl) {
551 acpi_status ret; 551 acpi_status ret;
552 ret = acpi_unload_table_id(ssdt_id); 552 ret = acpi_unload_parent_table(ssdt_hdl);
553 if (ACPI_FAILURE(ret)) { 553 if (ACPI_FAILURE(ret)) {
554 printk(KERN_ERR "%s: acpi_unload_table_id failed (0x%x) for id %d\n", 554 acpi_handle_err(ssdt_hdl,
555 __func__, ret, ssdt_id); 555 "%s: acpi_unload_parent_table failed (0x%x)\n",
556 __func__, ret);
556 /* try to continue on */ 557 /* try to continue on */
557 } 558 }
558 } 559 }
diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c
index 3542150fc8a3..489063987325 100644
--- a/drivers/pci/pci-acpi.c
+++ b/drivers/pci/pci-acpi.c
@@ -501,12 +501,29 @@ static int acpi_pci_run_wake(struct pci_dev *dev, bool enable)
501 return 0; 501 return 0;
502} 502}
503 503
504static bool acpi_pci_need_resume(struct pci_dev *dev)
505{
506 struct acpi_device *adev = ACPI_COMPANION(&dev->dev);
507
508 if (!adev || !acpi_device_power_manageable(adev))
509 return false;
510
511 if (device_may_wakeup(&dev->dev) != !!adev->wakeup.prepare_count)
512 return true;
513
514 if (acpi_target_system_state() == ACPI_STATE_S0)
515 return false;
516
517 return !!adev->power.flags.dsw_present;
518}
519
504static struct pci_platform_pm_ops acpi_pci_platform_pm = { 520static struct pci_platform_pm_ops acpi_pci_platform_pm = {
505 .is_manageable = acpi_pci_power_manageable, 521 .is_manageable = acpi_pci_power_manageable,
506 .set_state = acpi_pci_set_power_state, 522 .set_state = acpi_pci_set_power_state,
507 .choose_state = acpi_pci_choose_state, 523 .choose_state = acpi_pci_choose_state,
508 .sleep_wake = acpi_pci_sleep_wake, 524 .sleep_wake = acpi_pci_sleep_wake,
509 .run_wake = acpi_pci_run_wake, 525 .run_wake = acpi_pci_run_wake,
526 .need_resume = acpi_pci_need_resume,
510}; 527};
511 528
512void acpi_pci_add_bus(struct pci_bus *bus) 529void acpi_pci_add_bus(struct pci_bus *bus)
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
index 09a66bad8018..3cb2210de553 100644
--- a/drivers/pci/pci-driver.c
+++ b/drivers/pci/pci-driver.c
@@ -653,7 +653,6 @@ static bool pci_has_legacy_pm_support(struct pci_dev *pci_dev)
653static int pci_pm_prepare(struct device *dev) 653static int pci_pm_prepare(struct device *dev)
654{ 654{
655 struct device_driver *drv = dev->driver; 655 struct device_driver *drv = dev->driver;
656 int error = 0;
657 656
658 /* 657 /*
659 * Devices having power.ignore_children set may still be necessary for 658 * Devices having power.ignore_children set may still be necessary for
@@ -662,10 +661,12 @@ static int pci_pm_prepare(struct device *dev)
662 if (dev->power.ignore_children) 661 if (dev->power.ignore_children)
663 pm_runtime_resume(dev); 662 pm_runtime_resume(dev);
664 663
665 if (drv && drv->pm && drv->pm->prepare) 664 if (drv && drv->pm && drv->pm->prepare) {
666 error = drv->pm->prepare(dev); 665 int error = drv->pm->prepare(dev);
667 666 if (error)
668 return error; 667 return error;
668 }
669 return pci_dev_keep_suspended(to_pci_dev(dev));
669} 670}
670 671
671 672
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 460d046ab6fe..81f06e8dcc04 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -523,6 +523,11 @@ static inline int platform_pci_run_wake(struct pci_dev *dev, bool enable)
523 pci_platform_pm->run_wake(dev, enable) : -ENODEV; 523 pci_platform_pm->run_wake(dev, enable) : -ENODEV;
524} 524}
525 525
526static inline bool platform_pci_need_resume(struct pci_dev *dev)
527{
528 return pci_platform_pm ? pci_platform_pm->need_resume(dev) : false;
529}
530
526/** 531/**
527 * pci_raw_set_power_state - Use PCI PM registers to set the power state of 532 * pci_raw_set_power_state - Use PCI PM registers to set the power state of
528 * given PCI device 533 * given PCI device
@@ -2001,6 +2006,27 @@ bool pci_dev_run_wake(struct pci_dev *dev)
2001} 2006}
2002EXPORT_SYMBOL_GPL(pci_dev_run_wake); 2007EXPORT_SYMBOL_GPL(pci_dev_run_wake);
2003 2008
2009/**
2010 * pci_dev_keep_suspended - Check if the device can stay in the suspended state.
2011 * @pci_dev: Device to check.
2012 *
2013 * Return 'true' if the device is runtime-suspended, it doesn't have to be
2014 * reconfigured due to wakeup settings difference between system and runtime
2015 * suspend and the current power state of it is suitable for the upcoming
2016 * (system) transition.
2017 */
2018bool pci_dev_keep_suspended(struct pci_dev *pci_dev)
2019{
2020 struct device *dev = &pci_dev->dev;
2021
2022 if (!pm_runtime_suspended(dev)
2023 || (device_can_wakeup(dev) && !device_may_wakeup(dev))
2024 || platform_pci_need_resume(pci_dev))
2025 return false;
2026
2027 return pci_target_state(pci_dev) == pci_dev->current_state;
2028}
2029
2004void pci_config_pm_runtime_get(struct pci_dev *pdev) 2030void pci_config_pm_runtime_get(struct pci_dev *pdev)
2005{ 2031{
2006 struct device *dev = &pdev->dev; 2032 struct device *dev = &pdev->dev;
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
index d54632a1db43..4091f82239cd 100644
--- a/drivers/pci/pci.h
+++ b/drivers/pci/pci.h
@@ -50,6 +50,10 @@ int pci_probe_reset_function(struct pci_dev *dev);
50 * for given device (the device's wake-up capability has to be 50 * for given device (the device's wake-up capability has to be
51 * enabled by @sleep_wake for this feature to work) 51 * enabled by @sleep_wake for this feature to work)
52 * 52 *
53 * @need_resume: returns 'true' if the given device (which is currently
54 * suspended) needs to be resumed to be configured for system
55 * wakeup.
56 *
53 * If given platform is generally capable of power managing PCI devices, all of 57 * If given platform is generally capable of power managing PCI devices, all of
54 * these callbacks are mandatory. 58 * these callbacks are mandatory.
55 */ 59 */
@@ -59,6 +63,7 @@ struct pci_platform_pm_ops {
59 pci_power_t (*choose_state)(struct pci_dev *dev); 63 pci_power_t (*choose_state)(struct pci_dev *dev);
60 int (*sleep_wake)(struct pci_dev *dev, bool enable); 64 int (*sleep_wake)(struct pci_dev *dev, bool enable);
61 int (*run_wake)(struct pci_dev *dev, bool enable); 65 int (*run_wake)(struct pci_dev *dev, bool enable);
66 bool (*need_resume)(struct pci_dev *dev);
62}; 67};
63 68
64int pci_set_platform_pm(struct pci_platform_pm_ops *ops); 69int pci_set_platform_pm(struct pci_platform_pm_ops *ops);
@@ -67,6 +72,7 @@ void pci_power_up(struct pci_dev *dev);
67void pci_disable_enabled_device(struct pci_dev *dev); 72void pci_disable_enabled_device(struct pci_dev *dev);
68int pci_finish_runtime_suspend(struct pci_dev *dev); 73int pci_finish_runtime_suspend(struct pci_dev *dev);
69int __pci_pme_wakeup(struct pci_dev *dev, void *ign); 74int __pci_pme_wakeup(struct pci_dev *dev, void *ign);
75bool pci_dev_keep_suspended(struct pci_dev *dev);
70void pci_config_pm_runtime_get(struct pci_dev *dev); 76void pci_config_pm_runtime_get(struct pci_dev *dev);
71void pci_config_pm_runtime_put(struct pci_dev *dev); 77void pci_config_pm_runtime_put(struct pci_dev *dev);
72void pci_pm_init(struct pci_dev *dev); 78void pci_pm_init(struct pci_dev *dev);
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 23212f8ae09b..8d2f400e96cb 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -1895,7 +1895,7 @@ struct pci_bus *pci_create_root_bus(struct device *parent, int bus,
1895 int error; 1895 int error;
1896 struct pci_host_bridge *bridge; 1896 struct pci_host_bridge *bridge;
1897 struct pci_bus *b, *b2; 1897 struct pci_bus *b, *b2;
1898 struct pci_host_bridge_window *window, *n; 1898 struct resource_entry *window, *n;
1899 struct resource *res; 1899 struct resource *res;
1900 resource_size_t offset; 1900 resource_size_t offset;
1901 char bus_addr[64]; 1901 char bus_addr[64];
@@ -1959,8 +1959,8 @@ struct pci_bus *pci_create_root_bus(struct device *parent, int bus,
1959 printk(KERN_INFO "PCI host bridge to bus %s\n", dev_name(&b->dev)); 1959 printk(KERN_INFO "PCI host bridge to bus %s\n", dev_name(&b->dev));
1960 1960
1961 /* Add initial resources to the bus */ 1961 /* Add initial resources to the bus */
1962 list_for_each_entry_safe(window, n, resources, list) { 1962 resource_list_for_each_entry_safe(window, n, resources) {
1963 list_move_tail(&window->list, &bridge->windows); 1963 list_move_tail(&window->node, &bridge->windows);
1964 res = window->res; 1964 res = window->res;
1965 offset = window->offset; 1965 offset = window->offset;
1966 if (res->flags & IORESOURCE_BUS) 1966 if (res->flags & IORESOURCE_BUS)
@@ -2060,12 +2060,12 @@ void pci_bus_release_busn_res(struct pci_bus *b)
2060struct pci_bus *pci_scan_root_bus(struct device *parent, int bus, 2060struct pci_bus *pci_scan_root_bus(struct device *parent, int bus,
2061 struct pci_ops *ops, void *sysdata, struct list_head *resources) 2061 struct pci_ops *ops, void *sysdata, struct list_head *resources)
2062{ 2062{
2063 struct pci_host_bridge_window *window; 2063 struct resource_entry *window;
2064 bool found = false; 2064 bool found = false;
2065 struct pci_bus *b; 2065 struct pci_bus *b;
2066 int max; 2066 int max;
2067 2067
2068 list_for_each_entry(window, resources, list) 2068 resource_list_for_each_entry(window, resources)
2069 if (window->res->flags & IORESOURCE_BUS) { 2069 if (window->res->flags & IORESOURCE_BUS) {
2070 found = true; 2070 found = true;
2071 break; 2071 break;