diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-10-09 15:03:49 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-10-09 15:03:49 -0400 |
commit | 80213c03c4151d900cf293ef0fc51f8d88495e14 (patch) | |
tree | af2422fa255aed96c23cef894e0adbf817f30c45 /drivers/pci/pci.c | |
parent | ea584595fc85e65796335033dfca25ed655cd0ed (diff) | |
parent | f92d9ee3ab39841d1f29f2d1aa96ff7c74b36ee1 (diff) |
Merge tag 'pci-v3.18-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci
Pull PCI updates from Bjorn Helgaas:
"The interesting things here are:
- Turn on Config Request Retry Status Software Visibility. This
caused hangs last time, but we included a fix this time.
- Rework PCI device configuration to use _HPP/_HPX more aggressively
- Allow PCI devices to be put into D3cold during system suspend
- Add arm64 PCI support
- Add APM X-Gene host bridge driver
- Add TI Keystone host bridge driver
- Add Xilinx AXI host bridge driver
More detailed summary:
Enumeration
- Check Vendor ID only for Config Request Retry Status (Rajat Jain)
- Enable Config Request Retry Status when supported (Rajat Jain)
- Add generic domain handling (Catalin Marinas)
- Generate uppercase hex for modalias interface class (Ricardo Ribalda Delgado)
Resource management
- Add missing MEM_64 mask in pci_assign_unassigned_bridge_resources() (Yinghai Lu)
- Increase IBM ipr SAS Crocodile BARs to at least system page size (Douglas Lehr)
PCI device hotplug
- Prevent NULL dereference during pciehp probe (Andreas Noever)
- Move _HPP & _HPX handling into core (Bjorn Helgaas)
- Apply _HPP to PCIe devices as well as PCI (Bjorn Helgaas)
- Apply _HPP/_HPX to display devices (Bjorn Helgaas)
- Preserve SERR & PARITY settings when applying _HPP/_HPX (Bjorn Helgaas)
- Preserve MPS and MRRS settings when applying _HPP/_HPX (Bjorn Helgaas)
- Apply _HPP/_HPX to all devices, not just hot-added ones (Bjorn Helgaas)
- Fix wait time in pciehp timeout message (Yinghai Lu)
- Add more pciehp Slot Control debug output (Yinghai Lu)
- Stop disabling pciehp notifications during init (Yinghai Lu)
MSI
- Remove arch_msi_check_device() (Alexander Gordeev)
- Rename pci_msi_check_device() to pci_msi_supported() (Alexander Gordeev)
- Move D0 check into pci_msi_check_device() (Alexander Gordeev)
- Remove unused kobject from struct msi_desc (Yijing Wang)
- Remove "pos" from the struct msi_desc msi_attrib (Yijing Wang)
- Add "msi_bus" sysfs MSI/MSI-X control for endpoints (Yijing Wang)
- Use __get_cached_msi_msg() instead of get_cached_msi_msg() (Yijing Wang)
- Use __read_msi_msg() instead of read_msi_msg() (Yijing Wang)
- Use __write_msi_msg() instead of write_msi_msg() (Yijing Wang)
Power management
- Drop unused runtime PM support code for PCIe ports (Rafael J. Wysocki)
- Allow PCI devices to be put into D3cold during system suspend (Rafael J. Wysocki)
AER
- Add additional AER error strings (Gong Chen)
- Make <linux/aer.h> standalone includable (Thierry Reding)
Virtualization
- Add ACS quirk for Solarflare SFC9120 & SFC9140 (Alex Williamson)
- Add ACS quirk for Intel 10G NICs (Alex Williamson)
- Add ACS quirk for AMD A88X southbridge (Marti Raudsepp)
- Remove unused pci_find_upstream_pcie_bridge(), pci_get_dma_source() (Alex Williamson)
- Add device flag helpers (Ethan Zhao)
- Assume all Mellanox devices have broken INTx masking (Gavin Shan)
Generic host bridge driver
- Fix ioport_map() for !CONFIG_GENERIC_IOMAP (Liviu Dudau)
- Add pci_register_io_range() and pci_pio_to_address() (Liviu Dudau)
- Define PCI_IOBASE as the base of virtual PCI IO space (Liviu Dudau)
- Fix the conversion of IO ranges into IO resources (Liviu Dudau)
- Add pci_get_new_domain_nr() and of_get_pci_domain_nr() (Liviu Dudau)
- Add support for parsing PCI host bridge resources from DT (Liviu Dudau)
- Add pci_remap_iospace() to map bus I/O resources (Liviu Dudau)
- Add arm64 architectural support for PCI (Liviu Dudau)
APM X-Gene
- Add APM X-Gene PCIe driver (Tanmay Inamdar)
- Add arm64 DT APM X-Gene PCIe device tree nodes (Tanmay Inamdar)
Freescale i.MX6
- Probe in module_init(), not fs_initcall() (Lucas Stach)
- Delay enabling reference clock for SS until it stabilizes (Tim Harvey)
Marvell MVEBU
- Fix uninitialized variable in mvebu_get_tgt_attr() (Thomas Petazzoni)
NVIDIA Tegra
- Make sure the PCIe PLL is really reset (Eric Yuen)
- Add error path tegra_msi_teardown_irq() cleanup (Jisheng Zhang)
- Fix extended configuration space mapping (Peter Daifuku)
- Implement resource hierarchy (Thierry Reding)
- Clear CLKREQ# enable on port disable (Thierry Reding)
- Add Tegra124 support (Thierry Reding)
ST Microelectronics SPEAr13xx
- Pass config resource through reg property (Pratyush Anand)
Synopsys DesignWare
- Use NULL instead of false (Fabio Estevam)
- Parse bus-range property from devicetree (Lucas Stach)
- Use pci_create_root_bus() instead of pci_scan_root_bus() (Lucas Stach)
- Remove pci_assign_unassigned_resources() (Lucas Stach)
- Check private_data validity in single place (Lucas Stach)
- Setup and clear exactly one MSI at a time (Lucas Stach)
- Remove open-coded bitmap operations (Lucas Stach)
- Fix configuration base address when using 'reg' (Minghuan Lian)
- Fix IO resource end address calculation (Minghuan Lian)
- Rename get_msi_data() to get_msi_addr() (Minghuan Lian)
- Add get_msi_data() to pcie_host_ops (Minghuan Lian)
- Add support for v3.65 hardware (Murali Karicheri)
- Fold struct pcie_port_info into struct pcie_port (Pratyush Anand)
TI Keystone
- Add TI Keystone PCIe driver (Murali Karicheri)
- Limit MRSS for all downstream devices (Murali Karicheri)
- Assume controller is already in RC mode (Murali Karicheri)
- Set device ID based on SoC to support multiple ports (Murali Karicheri)
Xilinx AXI
- Add Xilinx AXI PCIe driver (Srikanth Thokala)
- Fix xilinx_pcie_assign_msi() return value test (Dan Carpenter)
Miscellaneous
- Clean up whitespace (Quentin Lambert)
- Remove assignments from "if" conditions (Quentin Lambert)
- Move PCI_VENDOR_ID_VMWARE to pci_ids.h (Francesco Ruggeri)
- x86: Mark DMI tables as initialization data (Mathias Krause)
- x86: Move __init annotation to the correct place (Mathias Krause)
- x86: Mark constants of pci_mmcfg_nvidia_mcp55() as __initconst (Mathias Krause)
- x86: Constify pci_mmcfg_probes[] array (Mathias Krause)
- x86: Mark PCI BIOS initialization code as such (Mathias Krause)
- Parenthesize PCI_DEVID and PCI_VPD_LRDT_ID parameters (Megan Kamiya)
- Remove unnecessary variable in pci_add_dynid() (Tobias Klauser)"
* tag 'pci-v3.18-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (109 commits)
arm64: dts: Add APM X-Gene PCIe device tree nodes
PCI: Add ACS quirk for AMD A88X southbridge devices
PCI: xgene: Add APM X-Gene PCIe driver
PCI: designware: Remove open-coded bitmap operations
PCI/MSI: Remove unnecessary temporary variable
PCI/MSI: Use __write_msi_msg() instead of write_msi_msg()
MSI/powerpc: Use __read_msi_msg() instead of read_msi_msg()
PCI/MSI: Use __get_cached_msi_msg() instead of get_cached_msi_msg()
PCI/MSI: Add "msi_bus" sysfs MSI/MSI-X control for endpoints
PCI/MSI: Remove "pos" from the struct msi_desc msi_attrib
PCI/MSI: Remove unused kobject from struct msi_desc
PCI/MSI: Rename pci_msi_check_device() to pci_msi_supported()
PCI/MSI: Move D0 check into pci_msi_check_device()
PCI/MSI: Remove arch_msi_check_device()
irqchip: armada-370-xp: Remove arch_msi_check_device()
PCI/MSI/PPC: Remove arch_msi_check_device()
arm64: Add architectural support for PCI
PCI: Add pci_remap_iospace() to map bus I/O resources
of/pci: Add support for parsing PCI host bridge resources from DT
of/pci: Add pci_get_new_domain_nr() and of_get_pci_domain_nr()
...
Conflicts:
arch/arm64/boot/dts/apm-storm.dtsi
Diffstat (limited to 'drivers/pci/pci.c')
-rw-r--r-- | drivers/pci/pci.c | 57 |
1 files changed, 50 insertions, 7 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 2c9ac70254e2..625a4ace10b4 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c | |||
@@ -1003,12 +1003,19 @@ int pci_save_state(struct pci_dev *dev) | |||
1003 | for (i = 0; i < 16; i++) | 1003 | for (i = 0; i < 16; i++) |
1004 | pci_read_config_dword(dev, i * 4, &dev->saved_config_space[i]); | 1004 | pci_read_config_dword(dev, i * 4, &dev->saved_config_space[i]); |
1005 | dev->state_saved = true; | 1005 | dev->state_saved = true; |
1006 | if ((i = pci_save_pcie_state(dev)) != 0) | 1006 | |
1007 | i = pci_save_pcie_state(dev); | ||
1008 | if (i != 0) | ||
1007 | return i; | 1009 | return i; |
1008 | if ((i = pci_save_pcix_state(dev)) != 0) | 1010 | |
1011 | i = pci_save_pcix_state(dev); | ||
1012 | if (i != 0) | ||
1009 | return i; | 1013 | return i; |
1010 | if ((i = pci_save_vc_state(dev)) != 0) | 1014 | |
1015 | i = pci_save_vc_state(dev); | ||
1016 | if (i != 0) | ||
1011 | return i; | 1017 | return i; |
1018 | |||
1012 | return 0; | 1019 | return 0; |
1013 | } | 1020 | } |
1014 | EXPORT_SYMBOL(pci_save_state); | 1021 | EXPORT_SYMBOL(pci_save_state); |
@@ -1907,10 +1914,6 @@ int pci_prepare_to_sleep(struct pci_dev *dev) | |||
1907 | if (target_state == PCI_POWER_ERROR) | 1914 | if (target_state == PCI_POWER_ERROR) |
1908 | return -EIO; | 1915 | return -EIO; |
1909 | 1916 | ||
1910 | /* D3cold during system suspend/hibernate is not supported */ | ||
1911 | if (target_state > PCI_D3hot) | ||
1912 | target_state = PCI_D3hot; | ||
1913 | |||
1914 | pci_enable_wake(dev, target_state, device_may_wakeup(&dev->dev)); | 1917 | pci_enable_wake(dev, target_state, device_may_wakeup(&dev->dev)); |
1915 | 1918 | ||
1916 | error = pci_set_power_state(dev, target_state); | 1919 | error = pci_set_power_state(dev, target_state); |
@@ -2704,6 +2707,37 @@ int pci_request_regions_exclusive(struct pci_dev *pdev, const char *res_name) | |||
2704 | } | 2707 | } |
2705 | EXPORT_SYMBOL(pci_request_regions_exclusive); | 2708 | EXPORT_SYMBOL(pci_request_regions_exclusive); |
2706 | 2709 | ||
2710 | /** | ||
2711 | * pci_remap_iospace - Remap the memory mapped I/O space | ||
2712 | * @res: Resource describing the I/O space | ||
2713 | * @phys_addr: physical address of range to be mapped | ||
2714 | * | ||
2715 | * Remap the memory mapped I/O space described by the @res | ||
2716 | * and the CPU physical address @phys_addr into virtual address space. | ||
2717 | * Only architectures that have memory mapped IO functions defined | ||
2718 | * (and the PCI_IOBASE value defined) should call this function. | ||
2719 | */ | ||
2720 | int __weak pci_remap_iospace(const struct resource *res, phys_addr_t phys_addr) | ||
2721 | { | ||
2722 | #if defined(PCI_IOBASE) && defined(CONFIG_MMU) | ||
2723 | unsigned long vaddr = (unsigned long)PCI_IOBASE + res->start; | ||
2724 | |||
2725 | if (!(res->flags & IORESOURCE_IO)) | ||
2726 | return -EINVAL; | ||
2727 | |||
2728 | if (res->end > IO_SPACE_LIMIT) | ||
2729 | return -EINVAL; | ||
2730 | |||
2731 | return ioremap_page_range(vaddr, vaddr + resource_size(res), phys_addr, | ||
2732 | pgprot_device(PAGE_KERNEL)); | ||
2733 | #else | ||
2734 | /* this architecture does not have memory mapped I/O space, | ||
2735 | so this function should never be called */ | ||
2736 | WARN_ONCE(1, "This architecture does not support memory mapped I/O\n"); | ||
2737 | return -ENODEV; | ||
2738 | #endif | ||
2739 | } | ||
2740 | |||
2707 | static void __pci_set_master(struct pci_dev *dev, bool enable) | 2741 | static void __pci_set_master(struct pci_dev *dev, bool enable) |
2708 | { | 2742 | { |
2709 | u16 old_cmd, cmd; | 2743 | u16 old_cmd, cmd; |
@@ -4406,6 +4440,15 @@ static void pci_no_domains(void) | |||
4406 | #endif | 4440 | #endif |
4407 | } | 4441 | } |
4408 | 4442 | ||
4443 | #ifdef CONFIG_PCI_DOMAINS | ||
4444 | static atomic_t __domain_nr = ATOMIC_INIT(-1); | ||
4445 | |||
4446 | int pci_get_new_domain_nr(void) | ||
4447 | { | ||
4448 | return atomic_inc_return(&__domain_nr); | ||
4449 | } | ||
4450 | #endif | ||
4451 | |||
4409 | /** | 4452 | /** |
4410 | * pci_ext_cfg_avail - can we access extended PCI config space? | 4453 | * pci_ext_cfg_avail - can we access extended PCI config space? |
4411 | * | 4454 | * |