diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-07-24 19:17:07 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-07-24 19:17:07 -0400 |
commit | 6dd53aa4563a2c69e80a24d2cc68d484b5ea2891 (patch) | |
tree | 0cca9f65984b524527910960d972fc6ef85fac88 /drivers/pci/pci-driver.c | |
parent | f14121ab35912e3d2e57ac9a4ce1f9d4b7baeffb (diff) | |
parent | 63b96f7baeba71966c723912c3f8f0274577f877 (diff) |
Merge tag 'for-3.6' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci
Pull PCI changes from Bjorn Helgaas:
"Host bridge hotplug:
- Add MMCONFIG support for hot-added host bridges (Jiang Liu)
Device hotplug:
- Move fixups from __init to __devinit (Sebastian Andrzej Siewior)
- Call FINAL fixups for hot-added devices, too (Myron Stowe)
- Factor out generic code for P2P bridge hot-add (Yinghai Lu)
- Remove all functions in a slot, not just those with _EJx (Amos
Kong)
Dynamic resource management:
- Track bus number allocation (struct resource tree per domain)
(Yinghai Lu)
- Make P2P bridge 1K I/O windows work with resource reassignment
(Bjorn Helgaas, Yinghai Lu)
- Disable decoding while updating 64-bit BARs (Bjorn Helgaas)
Power management:
- Add PCIe runtime D3cold support (Huang Ying)
Virtualization:
- Add VFIO infrastructure (ACS, DMA source ID quirks) (Alex
Williamson)
- Add quirks for devices with broken INTx masking (Jan Kiszka)
Miscellaneous:
- Fix some PCI Express capability version issues (Myron Stowe)
- Factor out some arch code with a weak, generic, pcibios_setup()
(Myron Stowe)"
* tag 'for-3.6' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (122 commits)
PCI: hotplug: ensure a consistent return value in error case
PCI: fix undefined reference to 'pci_fixup_final_inited'
PCI: build resource code for M68K architecture
PCI: pciehp: remove unused pciehp_get_max_lnk_width(), pciehp_get_cur_lnk_width()
PCI: reorder __pci_assign_resource() (no change)
PCI: fix truncation of resource size to 32 bits
PCI: acpiphp: merge acpiphp_debug and debug
PCI: acpiphp: remove unused res_lock
sparc/PCI: replace pci_cfg_fake_ranges() with pci_read_bridge_bases()
PCI: call final fixups hot-added devices
PCI: move final fixups from __init to __devinit
x86/PCI: move final fixups from __init to __devinit
MIPS/PCI: move final fixups from __init to __devinit
PCI: support sizing P2P bridge I/O windows with 1K granularity
PCI: reimplement P2P bridge 1K I/O windows (Intel P64H2)
PCI: disable MEM decoding while updating 64-bit MEM BARs
PCI: leave MEM and IO decoding disabled during 64-bit BAR sizing, too
PCI: never discard enable/suspend/resume_early/resume fixups
PCI: release temporary reference in __nv_msi_ht_cap_quirk()
PCI: restructure 'pci_do_fixups()'
...
Diffstat (limited to 'drivers/pci/pci-driver.c')
-rw-r--r-- | drivers/pci/pci-driver.c | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c index 099f46cd8e87..185be3703343 100644 --- a/drivers/pci/pci-driver.c +++ b/drivers/pci/pci-driver.c | |||
@@ -459,16 +459,17 @@ static int pci_restore_standard_config(struct pci_dev *pci_dev) | |||
459 | return 0; | 459 | return 0; |
460 | } | 460 | } |
461 | 461 | ||
462 | #endif | ||
463 | |||
464 | #ifdef CONFIG_PM_SLEEP | ||
465 | |||
462 | static void pci_pm_default_resume_early(struct pci_dev *pci_dev) | 466 | static void pci_pm_default_resume_early(struct pci_dev *pci_dev) |
463 | { | 467 | { |
464 | pci_restore_standard_config(pci_dev); | 468 | pci_power_up(pci_dev); |
469 | pci_restore_state(pci_dev); | ||
465 | pci_fixup_device(pci_fixup_resume_early, pci_dev); | 470 | pci_fixup_device(pci_fixup_resume_early, pci_dev); |
466 | } | 471 | } |
467 | 472 | ||
468 | #endif | ||
469 | |||
470 | #ifdef CONFIG_PM_SLEEP | ||
471 | |||
472 | /* | 473 | /* |
473 | * Default "suspend" method for devices that have no driver provided suspend, | 474 | * Default "suspend" method for devices that have no driver provided suspend, |
474 | * or not even a driver at all (second part). | 475 | * or not even a driver at all (second part). |
@@ -1031,10 +1032,13 @@ static int pci_pm_runtime_suspend(struct device *dev) | |||
1031 | if (!pm || !pm->runtime_suspend) | 1032 | if (!pm || !pm->runtime_suspend) |
1032 | return -ENOSYS; | 1033 | return -ENOSYS; |
1033 | 1034 | ||
1035 | pci_dev->no_d3cold = false; | ||
1034 | error = pm->runtime_suspend(dev); | 1036 | error = pm->runtime_suspend(dev); |
1035 | suspend_report_result(pm->runtime_suspend, error); | 1037 | suspend_report_result(pm->runtime_suspend, error); |
1036 | if (error) | 1038 | if (error) |
1037 | return error; | 1039 | return error; |
1040 | if (!pci_dev->d3cold_allowed) | ||
1041 | pci_dev->no_d3cold = true; | ||
1038 | 1042 | ||
1039 | pci_fixup_device(pci_fixup_suspend, pci_dev); | 1043 | pci_fixup_device(pci_fixup_suspend, pci_dev); |
1040 | 1044 | ||
@@ -1056,17 +1060,23 @@ static int pci_pm_runtime_suspend(struct device *dev) | |||
1056 | 1060 | ||
1057 | static int pci_pm_runtime_resume(struct device *dev) | 1061 | static int pci_pm_runtime_resume(struct device *dev) |
1058 | { | 1062 | { |
1063 | int rc; | ||
1059 | struct pci_dev *pci_dev = to_pci_dev(dev); | 1064 | struct pci_dev *pci_dev = to_pci_dev(dev); |
1060 | const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL; | 1065 | const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL; |
1061 | 1066 | ||
1062 | if (!pm || !pm->runtime_resume) | 1067 | if (!pm || !pm->runtime_resume) |
1063 | return -ENOSYS; | 1068 | return -ENOSYS; |
1064 | 1069 | ||
1065 | pci_pm_default_resume_early(pci_dev); | 1070 | pci_restore_standard_config(pci_dev); |
1071 | pci_fixup_device(pci_fixup_resume_early, pci_dev); | ||
1066 | __pci_enable_wake(pci_dev, PCI_D0, true, false); | 1072 | __pci_enable_wake(pci_dev, PCI_D0, true, false); |
1067 | pci_fixup_device(pci_fixup_resume, pci_dev); | 1073 | pci_fixup_device(pci_fixup_resume, pci_dev); |
1068 | 1074 | ||
1069 | return pm->runtime_resume(dev); | 1075 | rc = pm->runtime_resume(dev); |
1076 | |||
1077 | pci_dev->runtime_d3cold = false; | ||
1078 | |||
1079 | return rc; | ||
1070 | } | 1080 | } |
1071 | 1081 | ||
1072 | static int pci_pm_runtime_idle(struct device *dev) | 1082 | static int pci_pm_runtime_idle(struct device *dev) |