diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-08-02 17:12:29 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-08-02 17:12:29 -0400 |
commit | c8d0267efdb4ab16cd0ed6e0218e8c164006de48 (patch) | |
tree | d3e5367dbb5f05761323a8a98d87e061dc11774b /arch/powerpc | |
parent | affe8a2abd0d7815bb2653eea2717d0e0f8ac7e3 (diff) | |
parent | 9454c23852ca6d7aec89fd6fd46a046c323caac3 (diff) |
Merge tag 'pci-v4.8-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci
Pull PCI updates from Bjorn Helgaas:
"Highlights:
- ARM64 support for ACPI host bridges
- new drivers for Axis ARTPEC-6 and Marvell Aardvark
- new pci_alloc_irq_vectors() interface for MSI-X, MSI, legacy INTx
- pci_resource_to_user() cleanup (more to come)
Detailed summary:
Enumeration:
- Move ecam.h to linux/include/pci-ecam.h (Jayachandran C)
- Add parent device field to ECAM struct pci_config_window (Jayachandran C)
- Add generic MCFG table handling (Tomasz Nowicki)
- Refactor pci_bus_assign_domain_nr() for CONFIG_PCI_DOMAINS_GENERIC (Tomasz Nowicki)
- Factor DT-specific pci_bus_find_domain_nr() code out (Tomasz Nowicki)
Resource management:
- Add devm_request_pci_bus_resources() (Bjorn Helgaas)
- Unify pci_resource_to_user() declarations (Bjorn Helgaas)
- Implement pci_resource_to_user() with pcibios_resource_to_bus() (microblaze, powerpc, sparc) (Bjorn Helgaas)
- Request host bridge window resources (designware, iproc, rcar, xgene, xilinx, xilinx-nwl) (Bjorn Helgaas)
- Make PCI I/O space optional on ARM32 (Bjorn Helgaas)
- Ignore write combining when mapping I/O port space (Bjorn Helgaas)
- Claim bus resources on MIPS PCI_PROBE_ONLY set-ups (Bjorn Helgaas)
- Remove unicore32 pci=firmware command line parameter handling (Bjorn Helgaas)
- Support I/O resources when parsing host bridge resources (Jayachandran C)
- Add helpers to request/release memory and I/O regions (Johannes Thumshirn)
- Use pci_(request|release)_mem_regions (NVMe, lpfc, GenWQE, ethernet/intel, alx) (Johannes Thumshirn)
- Extend pci=resource_alignment to specify device/vendor IDs (Koehrer Mathias (ETAS/ESW5))
- Add generic pci_bus_claim_resources() (Lorenzo Pieralisi)
- Claim bus resources on ARM32 PCI_PROBE_ONLY set-ups (Lorenzo Pieralisi)
- Remove ARM32 and ARM64 arch-specific pcibios_enable_device() (Lorenzo Pieralisi)
- Add pci_unmap_iospace() to unmap I/O resources (Sinan Kaya)
- Remove powerpc __pci_mmap_set_pgprot() (Yinghai Lu)
PCI device hotplug:
- Allow additional bus numbers for hotplug bridges (Keith Busch)
- Ignore interrupts during D3cold (Lukas Wunner)
Power management:
- Enforce type casting for pci_power_t (Andy Shevchenko)
- Don't clear d3cold_allowed for PCIe ports (Mika Westerberg)
- Put PCIe ports into D3 during suspend (Mika Westerberg)
- Power on bridges before scanning new devices (Mika Westerberg)
- Runtime resume bridge before rescan (Mika Westerberg)
- Add runtime PM support for PCIe ports (Mika Westerberg)
- Remove redundant check of pcie_set_clkpm (Shawn Lin)
Virtualization:
- Add function 1 DMA alias quirk for Marvell 88SE9182 (Aaron Sierra)
- Add DMA alias quirk for Adaptec 3805 (Alex Williamson)
- Mark Atheros AR9485 and QCA9882 to avoid bus reset (Chris Blake)
- Add ACS quirk for Solarflare SFC9220 (Edward Cree)
MSI:
- Fix PCI_MSI dependencies (Arnd Bergmann)
- Add pci_msix_desc_addr() helper (Christoph Hellwig)
- Switch msix_program_entries() to use pci_msix_desc_addr() (Christoph Hellwig)
- Make the "entries" argument to pci_enable_msix() optional (Christoph Hellwig)
- Provide sensible IRQ vector alloc/free routines (Christoph Hellwig)
- Spread interrupt vectors in pci_alloc_irq_vectors() (Christoph Hellwig)
Error Handling:
- Bind DPC to Root Ports as well as Downstream Ports (Keith Busch)
- Remove DPC tristate module option (Keith Busch)
- Convert Downstream Port Containment driver to use devm_* functions (Mika Westerberg)
Generic host bridge driver:
- Select IRQ_DOMAIN (Arnd Bergmann)
- Claim bus resources on PCI_PROBE_ONLY set-ups (Lorenzo Pieralisi)
ACPI host bridge driver:
- Add ARM64 acpi_pci_bus_find_domain_nr() (Tomasz Nowicki)
- Add ARM64 ACPI support for legacy IRQs parsing and consolidation with DT code (Tomasz Nowicki)
- Implement ARM64 AML accessors for PCI_Config region (Tomasz Nowicki)
- Support ARM64 ACPI-based PCI host controller (Tomasz Nowicki)
Altera host bridge driver:
- Check link status before retrain link (Ley Foon Tan)
- Poll for link up status after retraining the link (Ley Foon Tan)
Axis ARTPEC-6 host bridge driver:
- Add PCI_MSI_IRQ_DOMAIN dependency (Arnd Bergmann)
- Add DT binding for Axis ARTPEC-6 PCIe controller (Niklas Cassel)
- Add Axis ARTPEC-6 PCIe controller driver (Niklas Cassel)
Intel VMD host bridge driver:
- Use lock save/restore in interrupt enable path (Jon Derrick)
- Select device dma ops to override (Keith Busch)
- Initialize list item in IRQ disable (Keith Busch)
- Use x86_vector_domain as parent domain (Keith Busch)
- Separate MSI and MSI-X vector sharing (Keith Busch)
Marvell Aardvark host bridge driver:
- Add DT binding for the Aardvark PCIe controller (Thomas Petazzoni)
- Add Aardvark PCI host controller driver (Thomas Petazzoni)
- Add Aardvark PCIe support for Armada 3700 (Thomas Petazzoni)
Microsoft Hyper-V host bridge driver:
- Fix interrupt cleanup path (Cathy Avery)
- Don't leak buffer in hv_pci_onchannelcallback() (Vitaly Kuznetsov)
- Handle all pending messages in hv_pci_onchannelcallback() (Vitaly Kuznetsov)
NVIDIA Tegra host bridge driver:
- Program PADS_REFCLK_CFG* always, not just on legacy SoCs (Stephen Warren)
- Program PADS_REFCLK_CFG* registers with per-SoC values (Stephen Warren)
- Use lower-case hex consistently for register definitions (Thierry Reding)
- Use generic pci_remap_iospace() rather than ARM32-specific one (Thierry Reding)
- Stop setting pcibios_min_mem (Thierry Reding)
Renesas R-Car host bridge driver:
- Drop gen2 dummy I/O port region (Bjorn Helgaas)
TI DRA7xx host bridge driver:
- Fix return value in case of error (Christophe JAILLET)
Xilinx AXI host bridge driver:
- Fix return value in case of error (Christophe JAILLET)
Miscellaneous:
- Make bus_attr_resource_alignment static (Ben Dooks)
- Include <asm/dma.h> for isa_dma_bridge_buggy (Ben Dooks)
- MAINTAINERS: Add file patterns for PCI device tree bindings (Geert Uytterhoeven)
- Make host bridge drivers explicitly non-modular (Paul Gortmaker)"
* tag 'pci-v4.8-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (125 commits)
PCI: xgene: Make explicitly non-modular
PCI: thunder-pem: Make explicitly non-modular
PCI: thunder-ecam: Make explicitly non-modular
PCI: tegra: Make explicitly non-modular
PCI: rcar-gen2: Make explicitly non-modular
PCI: rcar: Make explicitly non-modular
PCI: mvebu: Make explicitly non-modular
PCI: layerscape: Make explicitly non-modular
PCI: keystone: Make explicitly non-modular
PCI: hisi: Make explicitly non-modular
PCI: generic: Make explicitly non-modular
PCI: designware-plat: Make it explicitly non-modular
PCI: artpec6: Make explicitly non-modular
PCI: armada8k: Make explicitly non-modular
PCI: artpec: Add PCI_MSI_IRQ_DOMAIN dependency
PCI: Add ACS quirk for Solarflare SFC9220
arm64: dts: marvell: Add Aardvark PCIe support for Armada 3700
PCI: aardvark: Add Aardvark PCI host controller driver
dt-bindings: add DT binding for the Aardvark PCIe controller
PCI: tegra: Program PADS_REFCLK_CFG* registers with per-SoC values
...
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/include/asm/pci.h | 3 | ||||
-rw-r--r-- | arch/powerpc/kernel/pci-common.c | 79 |
2 files changed, 18 insertions, 64 deletions
diff --git a/arch/powerpc/include/asm/pci.h b/arch/powerpc/include/asm/pci.h index a6f3ac0d4602..e9bd6cf0212f 100644 --- a/arch/powerpc/include/asm/pci.h +++ b/arch/powerpc/include/asm/pci.h | |||
@@ -136,9 +136,6 @@ extern pgprot_t pci_phys_mem_access_prot(struct file *file, | |||
136 | pgprot_t prot); | 136 | pgprot_t prot); |
137 | 137 | ||
138 | #define HAVE_ARCH_PCI_RESOURCE_TO_USER | 138 | #define HAVE_ARCH_PCI_RESOURCE_TO_USER |
139 | extern void pci_resource_to_user(const struct pci_dev *dev, int bar, | ||
140 | const struct resource *rsrc, | ||
141 | resource_size_t *start, resource_size_t *end); | ||
142 | 139 | ||
143 | extern resource_size_t pcibios_io_space_offset(struct pci_controller *hose); | 140 | extern resource_size_t pcibios_io_space_offset(struct pci_controller *hose); |
144 | extern void pcibios_setup_bus_devices(struct pci_bus *bus); | 141 | extern void pcibios_setup_bus_devices(struct pci_bus *bus); |
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c index f93942b4b6a6..a5c0153ede37 100644 --- a/arch/powerpc/kernel/pci-common.c +++ b/arch/powerpc/kernel/pci-common.c | |||
@@ -412,36 +412,6 @@ static struct resource *__pci_mmap_make_offset(struct pci_dev *dev, | |||
412 | } | 412 | } |
413 | 413 | ||
414 | /* | 414 | /* |
415 | * Set vm_page_prot of VMA, as appropriate for this architecture, for a pci | ||
416 | * device mapping. | ||
417 | */ | ||
418 | static pgprot_t __pci_mmap_set_pgprot(struct pci_dev *dev, struct resource *rp, | ||
419 | pgprot_t protection, | ||
420 | enum pci_mmap_state mmap_state, | ||
421 | int write_combine) | ||
422 | { | ||
423 | |||
424 | /* Write combine is always 0 on non-memory space mappings. On | ||
425 | * memory space, if the user didn't pass 1, we check for a | ||
426 | * "prefetchable" resource. This is a bit hackish, but we use | ||
427 | * this to workaround the inability of /sysfs to provide a write | ||
428 | * combine bit | ||
429 | */ | ||
430 | if (mmap_state != pci_mmap_mem) | ||
431 | write_combine = 0; | ||
432 | else if (write_combine == 0) { | ||
433 | if (rp->flags & IORESOURCE_PREFETCH) | ||
434 | write_combine = 1; | ||
435 | } | ||
436 | |||
437 | /* XXX would be nice to have a way to ask for write-through */ | ||
438 | if (write_combine) | ||
439 | return pgprot_noncached_wc(protection); | ||
440 | else | ||
441 | return pgprot_noncached(protection); | ||
442 | } | ||
443 | |||
444 | /* | ||
445 | * This one is used by /dev/mem and fbdev who have no clue about the | 415 | * This one is used by /dev/mem and fbdev who have no clue about the |
446 | * PCI device, it tries to find the PCI device first and calls the | 416 | * PCI device, it tries to find the PCI device first and calls the |
447 | * above routine | 417 | * above routine |
@@ -514,9 +484,10 @@ int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, | |||
514 | return -EINVAL; | 484 | return -EINVAL; |
515 | 485 | ||
516 | vma->vm_pgoff = offset >> PAGE_SHIFT; | 486 | vma->vm_pgoff = offset >> PAGE_SHIFT; |
517 | vma->vm_page_prot = __pci_mmap_set_pgprot(dev, rp, | 487 | if (write_combine) |
518 | vma->vm_page_prot, | 488 | vma->vm_page_prot = pgprot_noncached_wc(vma->vm_page_prot); |
519 | mmap_state, write_combine); | 489 | else |
490 | vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); | ||
520 | 491 | ||
521 | ret = remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff, | 492 | ret = remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff, |
522 | vma->vm_end - vma->vm_start, vma->vm_page_prot); | 493 | vma->vm_end - vma->vm_start, vma->vm_page_prot); |
@@ -666,39 +637,25 @@ void pci_resource_to_user(const struct pci_dev *dev, int bar, | |||
666 | const struct resource *rsrc, | 637 | const struct resource *rsrc, |
667 | resource_size_t *start, resource_size_t *end) | 638 | resource_size_t *start, resource_size_t *end) |
668 | { | 639 | { |
669 | struct pci_controller *hose = pci_bus_to_host(dev->bus); | 640 | struct pci_bus_region region; |
670 | resource_size_t offset = 0; | ||
671 | 641 | ||
672 | if (hose == NULL) | 642 | if (rsrc->flags & IORESOURCE_IO) { |
643 | pcibios_resource_to_bus(dev->bus, ®ion, | ||
644 | (struct resource *) rsrc); | ||
645 | *start = region.start; | ||
646 | *end = region.end; | ||
673 | return; | 647 | return; |
648 | } | ||
674 | 649 | ||
675 | if (rsrc->flags & IORESOURCE_IO) | 650 | /* We pass a CPU physical address to userland for MMIO instead of a |
676 | offset = (unsigned long)hose->io_base_virt - _IO_BASE; | 651 | * BAR value because X is lame and expects to be able to use that |
677 | 652 | * to pass to /dev/mem! | |
678 | /* We pass a fully fixed up address to userland for MMIO instead of | ||
679 | * a BAR value because X is lame and expects to be able to use that | ||
680 | * to pass to /dev/mem ! | ||
681 | * | ||
682 | * That means that we'll have potentially 64 bits values where some | ||
683 | * userland apps only expect 32 (like X itself since it thinks only | ||
684 | * Sparc has 64 bits MMIO) but if we don't do that, we break it on | ||
685 | * 32 bits CHRPs :-( | ||
686 | * | ||
687 | * Hopefully, the sysfs insterface is immune to that gunk. Once X | ||
688 | * has been fixed (and the fix spread enough), we can re-enable the | ||
689 | * 2 lines below and pass down a BAR value to userland. In that case | ||
690 | * we'll also have to re-enable the matching code in | ||
691 | * __pci_mmap_make_offset(). | ||
692 | * | 653 | * |
693 | * BenH. | 654 | * That means we may have 64-bit values where some apps only expect |
655 | * 32 (like X itself since it thinks only Sparc has 64-bit MMIO). | ||
694 | */ | 656 | */ |
695 | #if 0 | 657 | *start = rsrc->start; |
696 | else if (rsrc->flags & IORESOURCE_MEM) | 658 | *end = rsrc->end; |
697 | offset = hose->pci_mem_offset; | ||
698 | #endif | ||
699 | |||
700 | *start = rsrc->start - offset; | ||
701 | *end = rsrc->end - offset; | ||
702 | } | 659 | } |
703 | 660 | ||
704 | /** | 661 | /** |