05 Jun, 2019

3 commits

  • Based on 1 normalized pattern(s):

    this code is released under the gnu general public license version 2

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 1 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Kate Stewart
    Reviewed-by: Armijn Hemel
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190531081037.657778837@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     
  • Based on 1 normalized pattern(s):

    gpl license summary [copyright] [c] [2010] [intel] [corporation]
    [all] [rights] [reserved] this program is free software you can
    redistribute it and or modify it under the terms of version 2 of the
    gnu general public license as published by the free software
    foundation this program is distributed in the hope that it will be
    useful but without any warranty without even the implied warranty of
    merchantability or fitness for a particular purpose see the gnu
    general public license for more details you should have received a
    copy of the gnu general public license along with this program if
    not write to the free software foundation inc 51 franklin st fifth
    floor boston ma 02110 1301 usa the full gnu general public license
    is included in this distribution in the file called license gpl

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 1 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Kate Stewart
    Reviewed-by: Allison Randal
    Reviewed-by: Armijn Hemel
    Reviewed-by: Alexios Zavras
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190530000436.477146092@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     
  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license version 2 as
    published by the free software foundation this program is
    distributed in the hope that it will be useful but without any
    warranty without even the implied warranty of merchantability or
    fitness for a particular purpose see the gnu general public license
    for more details you should have received a copy of the gnu general
    public license along with this program if not write to the free
    software foundation inc 59 temple place suite 330 boston ma 02111
    1307 usa

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 136 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Alexios Zavras
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190530000436.384967451@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

31 May, 2019

1 commit

  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license as published by
    the free software foundation either version 2 of the license or at
    your option any later version

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-or-later

    has been chosen to replace the boilerplate/reference in 3029 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190527070032.746973796@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

21 May, 2019

1 commit

  • Add SPDX license identifiers to all files which:

    - Have no license information of any form

    - Have EXPORT_.*_SYMBOL_GPL inside which was used in the
    initial scan/conversion to ignore the file

    These files fall under the project license, GPL v2 only. The resulting SPDX
    license identifier is:

    GPL-2.0-only

    Signed-off-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

18 Apr, 2019

1 commit

  • In pcibios_irq_init(), the PCI IRQ routing table 'pirq_table' is first
    found through pirq_find_routing_table(). If the table is not found and
    CONFIG_PCI_BIOS is defined, the table is then allocated in
    pcibios_get_irq_routing_table() using kmalloc(). Later, if the I/O APIC is
    used, this table is actually not used. In that case, the allocated table
    is not freed, which is a memory leak.

    Free the allocated table if it is not used.

    Signed-off-by: Wenwen Wang
    [bhelgaas: added Ingo's reviewed-by, since the only change since v1 was to
    use the irq_routing_table local variable name he suggested]
    Signed-off-by: Bjorn Helgaas
    Reviewed-by: Ingo Molnar
    Acked-by: Thomas Gleixner

    Wenwen Wang
     

07 Feb, 2019

1 commit

  • On Denverton's integration of the Intel(R) Trace Hub (for a reference and
    overview see Documentation/trace/intel_th.rst) the reported size of one of
    its resources (RTIT_BAR) doesn't match its actual size, which leads to
    overlaps with other devices' resources.

    In practice, it overlaps with XHCI MMIO space, which results in the xhci
    driver bailing out after seeing its registers as 0xffffffff, and perceived
    disappearance of all USB devices:

    intel_th_pci 0000:00:1f.7: enabling device (0004 -> 0006)
    xhci_hcd 0000:00:15.0: xHCI host controller not responding, assume dead
    xhci_hcd 0000:00:15.0: xHC not responding in xhci_irq, assume controller is dead
    xhci_hcd 0000:00:15.0: HC died; cleaning up
    usb 1-1: USB disconnect, device number 2

    For this reason, we need to resize the RTIT_BAR on Denverton to its actual
    size, which in this case is 4MB. The corresponding erratum is DNV36 at the
    link below:

    DNV36. Processor Host Root Complex May Incorrectly Route Memory
    Accesses to Intel® Trace Hub

    Problem: The Intel® Trace Hub RTIT_BAR (B0:D31:F7 offset 20h) is
    reported as a 2KB memory range. Due to this erratum, the
    processor Host Root Complex will forward addresses from
    RTIT_BAR to RTIT_BAR + 4MB -1 to Intel® Trace Hub.

    Implication: Devices assigned within the RTIT_BAR to RTIT_BAR + 4MB -1
    space may not function correctly.

    Workaround: A BIOS code change has been identified and may be
    implemented as a workaround for this erratum.

    Status: No Fix.

    Note that 5118ccd34780 ("intel_th: pci: Add Denverton SOC support") updates
    the Trace Hub driver so it claims the Denverton device, but the resource
    overlap exists regardless of whether that driver is loaded or that commit
    is included.

    Link: https://www.intel.com/content/dam/www/public/us/en/documents/specification-updates/atom-c3000-family-spec-update.pdf
    Signed-off-by: Alexander Shishkin
    [bhelgaas: include erratum text, clarify relationship with 5118ccd34780]
    Signed-off-by: Bjorn Helgaas
    Cc: stable@vger.kernel.org

    Alexander Shishkin
     

06 Jan, 2019

1 commit

  • Pull PCI updates from Bjorn Helgaas:

    - Remove unused lists from ASPM pcie_link_state (Frederick Lawler)

    - Fix Broadcom CNB20LE host bridge unintended sign extension (Colin Ian
    King)

    - Expand Kconfig "PF" acronyms (Randy Dunlap)

    - Update MAINTAINERS for arch/x86/kernel/early-quirks.c (Bjorn Helgaas)

    - Add missing include to drivers/pci.h (Alexandru Gagniuc)

    - Override Synopsys USB 3.x HAPS device class so dwc3-haps can claim it
    instead of xhci (Thinh Nguyen)

    - Clean up P2PDMA documentation (Randy Dunlap)

    - Allow runtime PM even if driver doesn't supply callbacks (Jarkko
    Nikula)

    - Remove status check after submitting Switchtec MRPC Firmware Download
    commands to avoid Completion Timeouts (Kelvin Cao)

    - Set Switchtec coherent DMA mask to allow 64-bit DMA (Boris Glimcher)

    - Fix Switchtec SWITCHTEC_IOCTL_EVENT_IDX_ALL flag overwrite issue
    (Joey Zhang)

    - Enable write combining for Switchtec MRPC Input buffers (Kelvin Cao)

    - Add Switchtec MRPC DMA mode support (Wesley Sheng)

    - Skip VF scanning on powerpc, which does this in firmware (Sebastian
    Ott)

    - Add Amlogic Meson PCIe controller driver and DT bindings (Yue Wang)

    - Constify histb dw_pcie_host_ops structure (Julia Lawall)

    - Support multiple power domains for imx6 (Leonard Crestez)

    - Constify layerscape driver data (Stefan Agner)

    - Update imx6 Kconfig to allow imx6 PCIe in imx7 kernel (Trent Piepho)

    - Support armada8k GPIO reset (Baruch Siach)

    - Support suspend/resume support on imx6 (Leonard Crestez)

    - Don't hard-code DesignWare DBI/ATU offst (Stephen Warren)

    - Skip i.MX6 PHY setup on i.MX7D (Andrey Smirnov)

    - Remove Jianguo Sun from HiSilicon STB maintainers (Lorenzo Pieralisi)

    - Mask DesignWare interrupts instead of disabling them to avoid lost
    interrupts (Marc Zyngier)

    - Add locking when acking DesignWare interrupts (Marc Zyngier)

    - Ack DesignWare interrupts in the proper callbacks (Marc Zyngier)

    - Use devm resource parser in mediatek (Honghui Zhang)

    - Remove unused mediatek "num-lanes" DT property (Honghui Zhang)

    - Add UniPhier PCIe controller driver and DT bindings (Kunihiko
    Hayashi)

    - Enable MSI for imx6 downstream components (Richard Zhu)

    * tag 'pci-v4.21-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (40 commits)
    PCI: imx: Enable MSI from downstream components
    s390/pci: skip VF scanning
    PCI/IOV: Add flag so platforms can skip VF scanning
    PCI/IOV: Factor out sriov_add_vfs()
    PCI: uniphier: Add UniPhier PCIe host controller support
    dt-bindings: PCI: Add UniPhier PCIe host controller description
    PCI: amlogic: Add the Amlogic Meson PCIe controller driver
    dt-bindings: PCI: meson: add DT bindings for Amlogic Meson PCIe controller
    arm64: dts: mt7622: Remove un-used property for PCIe
    arm: dts: mt7623: Remove un-used property for PCIe
    dt-bindings: PCI: MediaTek: Remove un-used property
    PCI: mediatek: Remove un-used variant in struct mtk_pcie_port
    MAINTAINERS: Remove Jianguo Sun from HiSilicon STB DWC entry
    PCI: dwc: Don't hard-code DBI/ATU offset
    PCI: imx: Add imx6sx suspend/resume support
    PCI: armada8k: Add support for gpio controlled reset signal
    PCI: dwc: Adjust Kconfig to allow IMX6 PCIe host on IMX7
    PCI: dwc: layerscape: Constify driver data
    PCI: imx: Add multi-pd support
    PCI: Override Synopsys USB 3.x HAPS device class
    ...

    Linus Torvalds
     

29 Dec, 2018

1 commit

  • Pull DMA mapping updates from Christoph Hellwig:
    "A huge update this time, but a lot of that is just consolidating or
    removing code:

    - provide a common DMA_MAPPING_ERROR definition and avoid indirect
    calls for dma_map_* error checking

    - use direct calls for the DMA direct mapping case, avoiding huge
    retpoline overhead for high performance workloads

    - merge the swiotlb dma_map_ops into dma-direct

    - provide a generic remapping DMA consistent allocator for
    architectures that have devices that perform DMA that is not cache
    coherent. Based on the existing arm64 implementation and also used
    for csky now.

    - improve the dma-debug infrastructure, including dynamic allocation
    of entries (Robin Murphy)

    - default to providing chaining scatterlist everywhere, with opt-outs
    for the few architectures (alpha, parisc, most arm32 variants) that
    can't cope with it

    - misc sparc32 dma-related cleanups

    - remove the dma_mark_clean arch hook used by swiotlb on ia64 and
    replace it with the generic noncoherent infrastructure

    - fix the return type of dma_set_max_seg_size (Niklas Söderlund)

    - move the dummy dma ops for not DMA capable devices from arm64 to
    common code (Robin Murphy)

    - ensure dma_alloc_coherent returns zeroed memory to avoid kernel
    data leaks through userspace. We already did this for most common
    architectures, but this ensures we do it everywhere.
    dma_zalloc_coherent has been deprecated and can hopefully be
    removed after -rc1 with a coccinelle script"

    * tag 'dma-mapping-4.21' of git://git.infradead.org/users/hch/dma-mapping: (73 commits)
    dma-mapping: fix inverted logic in dma_supported
    dma-mapping: deprecate dma_zalloc_coherent
    dma-mapping: zero memory returned from dma_alloc_*
    sparc/iommu: fix ->map_sg return value
    sparc/io-unit: fix ->map_sg return value
    arm64: default to the direct mapping in get_arch_dma_ops
    PCI: Remove unused attr variable in pci_dma_configure
    ia64: only select ARCH_HAS_DMA_COHERENT_TO_PFN if swiotlb is enabled
    dma-mapping: bypass indirect calls for dma-direct
    vmd: use the proper dma_* APIs instead of direct methods calls
    dma-direct: merge swiotlb_dma_ops into the dma_direct code
    dma-direct: use dma_direct_map_page to implement dma_direct_map_sg
    dma-direct: improve addressability error reporting
    swiotlb: remove dma_mark_clean
    swiotlb: remove SWIOTLB_MAP_ERROR
    ACPI / scan: Refactor _CCA enforcement
    dma-mapping: factor out dummy DMA ops
    dma-mapping: always build the direct mapping code
    dma-mapping: move dma_cache_sync out of line
    dma-mapping: move various slow path functions out of line
    ...

    Linus Torvalds
     

14 Dec, 2018

1 commit

  • While the dma-direct code is (relatively) clean and simple we actually
    have to use the swiotlb ops for the mapping on many architectures due
    to devices with addressing limits. Instead of keeping two
    implementations around this commit allows the dma-direct
    implementation to call the swiotlb bounce buffering functions and
    thus share the guts of the mapping implementation. This also
    simplified the dma-mapping setup on a few architectures where we
    don't have to differenciate which implementation to use.

    Signed-off-by: Christoph Hellwig
    Acked-by: Jesper Dangaard Brouer
    Tested-by: Jesper Dangaard Brouer
    Tested-by: Tony Luck

    Christoph Hellwig
     

09 Nov, 2018

2 commits

  • lockdep_assert_held() is better suited to checking locking requirements,
    since it only checks if the current thread holds the lock regardless of
    whether someone else does. This is also a step towards possibly removing
    spin_is_locked().

    Signed-off-by: Lance Roy
    Cc: Bjorn Helgaas
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Cc: Borislav Petkov
    Cc: "H. Peter Anvin"
    Cc:
    Cc:
    Signed-off-by: Paul E. McKenney

    Lance Roy
     
  • In the expression "word1 << 16", word1 starts as u16, but is promoted to a
    signed int, then sign-extended to resource_size_t, which is probably not
    what was intended. Cast to resource_size_t to avoid the sign extension.

    This fixes an identical issue as fixed by commit 0b2d70764bb3 ("x86/PCI:
    Fix Broadcom CNB20LE unintended sign extension") back in 2014.

    Detected by CoverityScan, CID#138749, 138750 ("Unintended sign extension")

    Fixes: 3f6ea84a3035 ("PCI: read memory ranges out of Broadcom CNB20LE host bridge")
    Signed-off-by: Colin Ian King
    Signed-off-by: Bjorn Helgaas

    Colin Ian King
     

31 Oct, 2018

1 commit

  • Move remaining definitions and declarations from include/linux/bootmem.h
    into include/linux/memblock.h and remove the redundant header.

    The includes were replaced with the semantic patch below and then
    semi-automated removal of duplicated '#include

    @@
    @@
    - #include
    + #include

    [sfr@canb.auug.org.au: dma-direct: fix up for the removal of linux/bootmem.h]
    Link: http://lkml.kernel.org/r/20181002185342.133d1680@canb.auug.org.au
    [sfr@canb.auug.org.au: powerpc: fix up for removal of linux/bootmem.h]
    Link: http://lkml.kernel.org/r/20181005161406.73ef8727@canb.auug.org.au
    [sfr@canb.auug.org.au: x86/kaslr, ACPI/NUMA: fix for linux/bootmem.h removal]
    Link: http://lkml.kernel.org/r/20181008190341.5e396491@canb.auug.org.au
    Link: http://lkml.kernel.org/r/1536927045-23536-30-git-send-email-rppt@linux.vnet.ibm.com
    Signed-off-by: Mike Rapoport
    Signed-off-by: Stephen Rothwell
    Acked-by: Michal Hocko
    Cc: Catalin Marinas
    Cc: Chris Zankel
    Cc: "David S. Miller"
    Cc: Geert Uytterhoeven
    Cc: Greentime Hu
    Cc: Greg Kroah-Hartman
    Cc: Guan Xuetao
    Cc: Ingo Molnar
    Cc: "James E.J. Bottomley"
    Cc: Jonas Bonn
    Cc: Jonathan Corbet
    Cc: Ley Foon Tan
    Cc: Mark Salter
    Cc: Martin Schwidefsky
    Cc: Matt Turner
    Cc: Michael Ellerman
    Cc: Michal Simek
    Cc: Palmer Dabbelt
    Cc: Paul Burton
    Cc: Richard Kuo
    Cc: Richard Weinberger
    Cc: Rich Felker
    Cc: Russell King
    Cc: Serge Semin
    Cc: Thomas Gleixner
    Cc: Tony Luck
    Cc: Vineet Gupta
    Cc: Yoshinori Sato
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Rapoport
     

25 Oct, 2018

1 commit

  • Pull PCI updates from Bjorn Helgaas:

    - Fix ASPM link_state teardown on removal (Lukas Wunner)

    - Fix misleading _OSC ASPM message (Sinan Kaya)

    - Make _OSC optional for PCI (Sinan Kaya)

    - Don't initialize ASPM link state when ACPI_FADT_NO_ASPM is set
    (Patrick Talbert)

    - Remove x86 and arm64 node-local allocation for host bridge structures
    (Punit Agrawal)

    - Pay attention to device-specific _PXM node values (Jonathan Cameron)

    - Support new Immediate Readiness bit (Felipe Balbi)

    - Differentiate between pciehp surprise and safe removal (Lukas Wunner)

    - Remove unnecessary pciehp includes (Lukas Wunner)

    - Drop pciehp hotplug_slot_ops wrappers (Lukas Wunner)

    - Tolerate PCIe Slot Presence Detect being hardwired to zero to
    workaround broken hardware, e.g., the Wilocity switch/wireless device
    (Lukas Wunner)

    - Unify pciehp controller & slot structs (Lukas Wunner)

    - Constify hotplug_slot_ops (Lukas Wunner)

    - Drop hotplug_slot_info (Lukas Wunner)

    - Embed hotplug_slot struct into users instead of allocating it
    separately (Lukas Wunner)

    - Initialize PCIe port service drivers directly instead of relying on
    initcall ordering (Keith Busch)

    - Restore PCI config state after a slot reset (Keith Busch)

    - Save/restore DPC config state along with other PCI config state
    (Keith Busch)

    - Reference count devices during AER handling to avoid race issue with
    concurrent hot removal (Keith Busch)

    - If an Upstream Port reports ERR_FATAL, don't try to read the Port's
    config space because it is probably unreachable (Keith Busch)

    - During error handling, use slot-specific reset instead of secondary
    bus reset to avoid link up/down issues on hotplug ports (Keith Busch)

    - Restore previous AER/DPC handling that does not remove and
    re-enumerate devices on ERR_FATAL (Keith Busch)

    - Notify all drivers that may be affected by error recovery resets
    (Keith Busch)

    - Always generate error recovery uevents, even if a driver doesn't have
    error callbacks (Keith Busch)

    - Make PCIe link active reporting detection generic (Keith Busch)

    - Support D3cold in PCIe hierarchies during system sleep and runtime,
    including hotplug and Thunderbolt ports (Mika Westerberg)

    - Handle hpmemsize/hpiosize kernel parameters uniformly, whether slots
    are empty or occupied (Jon Derrick)

    - Remove duplicated include from pci/pcie/err.c and unused variable
    from cpqphp (YueHaibing)

    - Remove driver pci_cleanup_aer_uncorrect_error_status() calls (Oza
    Pawandeep)

    - Uninline PCI bus accessors for better ftracing (Keith Busch)

    - Remove unused AER Root Port .error_resume method (Keith Busch)

    - Use kfifo in AER instead of a local version (Keith Busch)

    - Use threaded IRQ in AER bottom half (Keith Busch)

    - Use managed resources in AER core (Keith Busch)

    - Reuse pcie_port_find_device() for AER injection (Keith Busch)

    - Abstract AER interrupt handling to disconnect error injection (Keith
    Busch)

    - Refactor AER injection callbacks to simplify future improvments
    (Keith Busch)

    - Remove unused Netronome NFP32xx Device IDs (Jakub Kicinski)

    - Use bitmap_zalloc() for dma_alias_mask (Andy Shevchenko)

    - Add switch fall-through annotations (Gustavo A. R. Silva)

    - Remove unused Switchtec quirk variable (Joshua Abraham)

    - Fix pci.c kernel-doc warning (Randy Dunlap)

    - Remove trivial PCI wrappers for DMA APIs (Christoph Hellwig)

    - Add Intel GPU device IDs to spurious interrupt quirk (Bin Meng)

    - Run Switchtec DMA aliasing quirk only on NTB endpoints to avoid
    useless dmesg errors (Logan Gunthorpe)

    - Update Switchtec NTB documentation (Wesley Yung)

    - Remove redundant "default n" from Kconfig (Bartlomiej Zolnierkiewicz)

    - Avoid panic when drivers enable MSI/MSI-X twice (Tonghao Zhang)

    - Add PCI support for peer-to-peer DMA (Logan Gunthorpe)

    - Add sysfs group for PCI peer-to-peer memory statistics (Logan
    Gunthorpe)

    - Add PCI peer-to-peer DMA scatterlist mapping interface (Logan
    Gunthorpe)

    - Add PCI configfs/sysfs helpers for use by peer-to-peer users (Logan
    Gunthorpe)

    - Add PCI peer-to-peer DMA driver writer's documentation (Logan
    Gunthorpe)

    - Add block layer flag to indicate driver support for PCI peer-to-peer
    DMA (Logan Gunthorpe)

    - Map Infiniband scatterlists for peer-to-peer DMA if they contain P2P
    memory (Logan Gunthorpe)

    - Register nvme-pci CMB buffer as PCI peer-to-peer memory (Logan
    Gunthorpe)

    - Add nvme-pci support for PCI peer-to-peer memory in requests (Logan
    Gunthorpe)

    - Use PCI peer-to-peer memory in nvme (Stephen Bates, Steve Wise,
    Christoph Hellwig, Logan Gunthorpe)

    - Cache VF config space size to optimize enumeration of many VFs
    (KarimAllah Ahmed)

    - Remove unnecessary include (Bjorn Helgaas)

    - Fix VMD AERSID quirk Device ID matching (Jon Derrick)

    - Fix Cadence PHY handling during probe (Alan Douglas)

    - Signal Cadence Endpoint interrupts via AXI region 0 instead of last
    region (Alan Douglas)

    - Write Cadence Endpoint MSI interrupts with 32 bits of data (Alan
    Douglas)

    - Remove redundant controller tests for "device_type == pci" (Rob
    Herring)

    - Document R-Car E3 (R8A77990) bindings (Tho Vu)

    - Add device tree support for R-Car r8a7744 (Biju Das)

    - Drop unused mvebu PCIe capability code (Thomas Petazzoni)

    - Add shared PCI bridge emulation code (Thomas Petazzoni)

    - Convert mvebu to use shared PCI bridge emulation (Thomas Petazzoni)

    - Add aardvark Root Port emulation (Thomas Petazzoni)

    - Support 100MHz/200MHz refclocks for i.MX6 (Lucas Stach)

    - Add initial power management for i.MX7 (Leonard Crestez)

    - Add PME_Turn_Off support for i.MX7 (Leonard Crestez)

    - Fix qcom runtime power management error handling (Bjorn Andersson)

    - Update TI dra7xx unaligned access errata workaround for host mode as
    well as endpoint mode (Vignesh R)

    - Fix kirin section mismatch warning (Nathan Chancellor)

    - Remove iproc PAXC slot check to allow VF support (Jitendra Bhivare)

    - Quirk Keystone K2G to limit MRRS to 256 (Kishon Vijay Abraham I)

    - Update Keystone to use MRRS quirk for host bridge instead of open
    coding (Kishon Vijay Abraham I)

    - Refactor Keystone link establishment (Kishon Vijay Abraham I)

    - Simplify and speed up Keystone link training (Kishon Vijay Abraham I)

    - Remove unused Keystone host_init argument (Kishon Vijay Abraham I)

    - Merge Keystone driver files into one (Kishon Vijay Abraham I)

    - Remove redundant Keystone platform_set_drvdata() (Kishon Vijay
    Abraham I)

    - Rename Keystone functions for uniformity (Kishon Vijay Abraham I)

    - Add Keystone device control module DT binding (Kishon Vijay Abraham
    I)

    - Use SYSCON API to get Keystone control module device IDs (Kishon
    Vijay Abraham I)

    - Clean up Keystone PHY handling (Kishon Vijay Abraham I)

    - Use runtime PM APIs to enable Keystone clock (Kishon Vijay Abraham I)

    - Clean up Keystone config space access checks (Kishon Vijay Abraham I)

    - Get Keystone outbound window count from DT (Kishon Vijay Abraham I)

    - Clean up Keystone outbound window configuration (Kishon Vijay Abraham
    I)

    - Clean up Keystone DBI setup (Kishon Vijay Abraham I)

    - Clean up Keystone ks_pcie_link_up() (Kishon Vijay Abraham I)

    - Fix Keystone IRQ status checking (Kishon Vijay Abraham I)

    - Add debug messages for all Keystone errors (Kishon Vijay Abraham I)

    - Clean up Keystone includes and macros (Kishon Vijay Abraham I)

    - Fix Mediatek unchecked return value from devm_pci_remap_iospace()
    (Gustavo A. R. Silva)

    - Fix Mediatek endpoint/port matching logic (Honghui Zhang)

    - Change Mediatek Root Port Class Code to PCI_CLASS_BRIDGE_PCI (Honghui
    Zhang)

    - Remove redundant Mediatek PM domain check (Honghui Zhang)

    - Convert Mediatek to pci_host_probe() (Honghui Zhang)

    - Fix Mediatek MSI enablement (Honghui Zhang)

    - Add Mediatek system PM support for MT2712 and MT7622 (Honghui Zhang)

    - Add Mediatek loadable module support (Honghui Zhang)

    - Detach VMD resources after stopping root bus to prevent orphan
    resources (Jon Derrick)

    - Convert pcitest build process to that used by other tools (iio, perf,
    etc) (Gustavo Pimentel)

    * tag 'pci-v4.20-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (140 commits)
    PCI/AER: Refactor error injection fallbacks
    PCI/AER: Abstract AER interrupt handling
    PCI/AER: Reuse existing pcie_port_find_device() interface
    PCI/AER: Use managed resource allocations
    PCI: pcie: Remove redundant 'default n' from Kconfig
    PCI: aardvark: Implement emulated root PCI bridge config space
    PCI: mvebu: Convert to PCI emulated bridge config space
    PCI: mvebu: Drop unused PCI express capability code
    PCI: Introduce PCI bridge emulated config space common logic
    PCI: vmd: Detach resources after stopping root bus
    nvmet: Optionally use PCI P2P memory
    nvmet: Introduce helper functions to allocate and free request SGLs
    nvme-pci: Add support for P2P memory in requests
    nvme-pci: Use PCI p2pmem subsystem to manage the CMB
    IB/core: Ensure we map P2P memory correctly in rdma_rw_ctx_[init|destroy]()
    block: Add PCI P2P flag for request queue
    PCI/P2PDMA: Add P2P DMA driver writer's documentation
    docs-rst: Add a new directory for PCI documentation
    PCI/P2PDMA: Introduce configfs/sysfs enable attribute helpers
    PCI/P2PDMA: Add PCI p2pmem DMA mappings to adjust the bus offset
    ...

    Linus Torvalds
     

21 Oct, 2018

1 commit


03 Oct, 2018

1 commit


28 Sep, 2018

1 commit

  • Hygon's PCI vendor ID is 0x1d94, and there are PCI devices
    0x1450/0x1463/0x1464 for the host bridge on the Hygon Dhyana platform.
    Add Hygon Dhyana support to the PCI and northbridge subsystems by using
    the code path of AMD family 17h.

    [ bp: Massage commit message, sort local vars into reverse xmas tree
    order and move the amd_northbridges.num check up. ]

    Signed-off-by: Pu Wen
    Signed-off-by: Borislav Petkov
    Acked-by: Bjorn Helgaas # pci_ids.h
    Cc: tglx@linutronix.de
    Cc: mingo@redhat.com
    Cc: hpa@zytor.com
    Cc: x86@kernel.org
    Cc: thomas.lendacky@amd.com
    Cc: helgaas@kernel.org
    Cc: linux-pci@vger.kernel.org
    Link: https://lkml.kernel.org/r/5f8877bd413f2ea0833378dd5454df0720e1c0df.1537885177.git.puwen@hygon.cn

    Pu Wen
     

18 Sep, 2018

1 commit

  • Memory for host controller data structures is allocated local to the node
    to which the controller is associated with. This has been the behaviour
    since 965cd0e4a5e5 ("x86, PCI, ACPI: Use kmalloc_node() to optimize for
    performance") where the node local allocation was added without additional
    context.

    Drop the node local allocation as there is no benefit from doing so - the
    usage of these structures is independent from where the controller is
    located.

    Signed-off-by: Punit Agrawal
    Signed-off-by: Bjorn Helgaas
    Cc: Thomas Gleixner
    Cc: "H. Peter Anvin"

    Punit Agrawal
     

30 Jun, 2018

1 commit

  • Move early dump functionality into common code so that it is available for
    all architectures. No need to carry arch-specific reads around as the read
    hooks are already initialized by the time pci_setup_device() is getting
    called during scan.

    Tested-by: Andy Shevchenko
    Signed-off-by: Sinan Kaya
    Signed-off-by: Bjorn Helgaas
    Reviewed-by: Andy Shevchenko

    Sinan Kaya
     

13 Jun, 2018

1 commit

  • The kzalloc() function has a 2-factor argument form, kcalloc(). This
    patch replaces cases of:

    kzalloc(a * b, gfp)

    with:
    kcalloc(a * b, gfp)

    as well as handling cases of:

    kzalloc(a * b * c, gfp)

    with:

    kzalloc(array3_size(a, b, c), gfp)

    as it's slightly less ugly than:

    kzalloc_array(array_size(a, b), c, gfp)

    This does, however, attempt to ignore constant size factors like:

    kzalloc(4 * 1024, gfp)

    though any constants defined via macros get caught up in the conversion.

    Any factors with a sizeof() of "unsigned char", "char", and "u8" were
    dropped, since they're redundant.

    The Coccinelle script used for this was:

    // Fix redundant parens around sizeof().
    @@
    type TYPE;
    expression THING, E;
    @@

    (
    kzalloc(
    - (sizeof(TYPE)) * E
    + sizeof(TYPE) * E
    , ...)
    |
    kzalloc(
    - (sizeof(THING)) * E
    + sizeof(THING) * E
    , ...)
    )

    // Drop single-byte sizes and redundant parens.
    @@
    expression COUNT;
    typedef u8;
    typedef __u8;
    @@

    (
    kzalloc(
    - sizeof(u8) * (COUNT)
    + COUNT
    , ...)
    |
    kzalloc(
    - sizeof(__u8) * (COUNT)
    + COUNT
    , ...)
    |
    kzalloc(
    - sizeof(char) * (COUNT)
    + COUNT
    , ...)
    |
    kzalloc(
    - sizeof(unsigned char) * (COUNT)
    + COUNT
    , ...)
    |
    kzalloc(
    - sizeof(u8) * COUNT
    + COUNT
    , ...)
    |
    kzalloc(
    - sizeof(__u8) * COUNT
    + COUNT
    , ...)
    |
    kzalloc(
    - sizeof(char) * COUNT
    + COUNT
    , ...)
    |
    kzalloc(
    - sizeof(unsigned char) * COUNT
    + COUNT
    , ...)
    )

    // 2-factor product with sizeof(type/expression) and identifier or constant.
    @@
    type TYPE;
    expression THING;
    identifier COUNT_ID;
    constant COUNT_CONST;
    @@

    (
    - kzalloc
    + kcalloc
    (
    - sizeof(TYPE) * (COUNT_ID)
    + COUNT_ID, sizeof(TYPE)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(TYPE) * COUNT_ID
    + COUNT_ID, sizeof(TYPE)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(TYPE) * (COUNT_CONST)
    + COUNT_CONST, sizeof(TYPE)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(TYPE) * COUNT_CONST
    + COUNT_CONST, sizeof(TYPE)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(THING) * (COUNT_ID)
    + COUNT_ID, sizeof(THING)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(THING) * COUNT_ID
    + COUNT_ID, sizeof(THING)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(THING) * (COUNT_CONST)
    + COUNT_CONST, sizeof(THING)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(THING) * COUNT_CONST
    + COUNT_CONST, sizeof(THING)
    , ...)
    )

    // 2-factor product, only identifiers.
    @@
    identifier SIZE, COUNT;
    @@

    - kzalloc
    + kcalloc
    (
    - SIZE * COUNT
    + COUNT, SIZE
    , ...)

    // 3-factor product with 1 sizeof(type) or sizeof(expression), with
    // redundant parens removed.
    @@
    expression THING;
    identifier STRIDE, COUNT;
    type TYPE;
    @@

    (
    kzalloc(
    - sizeof(TYPE) * (COUNT) * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    kzalloc(
    - sizeof(TYPE) * (COUNT) * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    kzalloc(
    - sizeof(TYPE) * COUNT * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    kzalloc(
    - sizeof(TYPE) * COUNT * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(TYPE))
    , ...)
    |
    kzalloc(
    - sizeof(THING) * (COUNT) * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    |
    kzalloc(
    - sizeof(THING) * (COUNT) * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    |
    kzalloc(
    - sizeof(THING) * COUNT * (STRIDE)
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    |
    kzalloc(
    - sizeof(THING) * COUNT * STRIDE
    + array3_size(COUNT, STRIDE, sizeof(THING))
    , ...)
    )

    // 3-factor product with 2 sizeof(variable), with redundant parens removed.
    @@
    expression THING1, THING2;
    identifier COUNT;
    type TYPE1, TYPE2;
    @@

    (
    kzalloc(
    - sizeof(TYPE1) * sizeof(TYPE2) * COUNT
    + array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
    , ...)
    |
    kzalloc(
    - sizeof(TYPE1) * sizeof(THING2) * (COUNT)
    + array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
    , ...)
    |
    kzalloc(
    - sizeof(THING1) * sizeof(THING2) * COUNT
    + array3_size(COUNT, sizeof(THING1), sizeof(THING2))
    , ...)
    |
    kzalloc(
    - sizeof(THING1) * sizeof(THING2) * (COUNT)
    + array3_size(COUNT, sizeof(THING1), sizeof(THING2))
    , ...)
    |
    kzalloc(
    - sizeof(TYPE1) * sizeof(THING2) * COUNT
    + array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
    , ...)
    |
    kzalloc(
    - sizeof(TYPE1) * sizeof(THING2) * (COUNT)
    + array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
    , ...)
    )

    // 3-factor product, only identifiers, with redundant parens removed.
    @@
    identifier STRIDE, SIZE, COUNT;
    @@

    (
    kzalloc(
    - (COUNT) * STRIDE * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kzalloc(
    - COUNT * (STRIDE) * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kzalloc(
    - COUNT * STRIDE * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kzalloc(
    - (COUNT) * (STRIDE) * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kzalloc(
    - COUNT * (STRIDE) * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kzalloc(
    - (COUNT) * STRIDE * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kzalloc(
    - (COUNT) * (STRIDE) * (SIZE)
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    |
    kzalloc(
    - COUNT * STRIDE * SIZE
    + array3_size(COUNT, STRIDE, SIZE)
    , ...)
    )

    // Any remaining multi-factor products, first at least 3-factor products,
    // when they're not all constants...
    @@
    expression E1, E2, E3;
    constant C1, C2, C3;
    @@

    (
    kzalloc(C1 * C2 * C3, ...)
    |
    kzalloc(
    - (E1) * E2 * E3
    + array3_size(E1, E2, E3)
    , ...)
    |
    kzalloc(
    - (E1) * (E2) * E3
    + array3_size(E1, E2, E3)
    , ...)
    |
    kzalloc(
    - (E1) * (E2) * (E3)
    + array3_size(E1, E2, E3)
    , ...)
    |
    kzalloc(
    - E1 * E2 * E3
    + array3_size(E1, E2, E3)
    , ...)
    )

    // And then all remaining 2 factors products when they're not all constants,
    // keeping sizeof() as the second factor argument.
    @@
    expression THING, E1, E2;
    type TYPE;
    constant C1, C2, C3;
    @@

    (
    kzalloc(sizeof(THING) * C2, ...)
    |
    kzalloc(sizeof(TYPE) * C2, ...)
    |
    kzalloc(C1 * C2 * C3, ...)
    |
    kzalloc(C1 * C2, ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(TYPE) * (E2)
    + E2, sizeof(TYPE)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(TYPE) * E2
    + E2, sizeof(TYPE)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(THING) * (E2)
    + E2, sizeof(THING)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - sizeof(THING) * E2
    + E2, sizeof(THING)
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - (E1) * E2
    + E1, E2
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - (E1) * (E2)
    + E1, E2
    , ...)
    |
    - kzalloc
    + kcalloc
    (
    - E1 * E2
    + E1, E2
    , ...)
    )

    Signed-off-by: Kees Cook

    Kees Cook
     

07 Jun, 2018

1 commit

  • - support VMD "membar shadow" feature (Jon Derrick)

    - support VMD bus number offsets (Jon Derrick)

    - add VMD "no AER source ID" quirk for more device IDs (Jon Derrick)

    * lorenzo/pci/vmd:
    PCI: vmd: Add an additional VMD device id to driver device id table
    x86/PCI: Add additional VMD device root ports to VMD AER quirk
    PCI: vmd: Add offset to bus numbers if necessary
    PCI: vmd: Assign membar addresses from shadow registers
    PCI: Add Intel VMD devices to pci ids

    Bjorn Helgaas
     

25 May, 2018

1 commit


28 Apr, 2018

1 commit

  • Currently the early dump of PCI configuration space looks quite unhelpful,
    e.g.

    [ 0.000000] 60:
    [ 0.000000] 00
    [ 0.000000] 00
    [ 0.000000] 00
    [ 0.000000] 00
    [ 0.000000] 00
    [ 0.000000] 00
    [ 0.000000] 00
    [ 0.000000] 00
    [ 0.000000] 00
    [ 0.000000] 00
    [ 0.000000] 00
    [ 0.000000] 00
    [ 0.000000] 00
    [ 0.000000] 00
    [ 0.000000] 00
    [ 0.000000] 00
    [ 0.000000]

    which makes really hard to get anything out of this. Convert the function
    to use print_hex_dump() to make output neat.

    In the result we will have

    [ 0.000000] 00000060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

    which is much, much better.

    Reviewed-by: Mika Westerberg
    Signed-off-by: Andy Shevchenko
    Signed-off-by: Bjorn Helgaas
    Acked-by: Ingo Molnar

    Andy Shevchenko
     

03 Apr, 2018

1 commit

  • Pull x86 dma mapping updates from Ingo Molnar:
    "This tree, by Christoph Hellwig, switches over the x86 architecture to
    the generic dma-direct and swiotlb code, and also unifies more of the
    dma-direct code between architectures. The now unused x86-only
    primitives are removed"

    * 'x86-dma-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    dma-mapping: Don't clear GFP_ZERO in dma_alloc_attrs
    swiotlb: Make swiotlb_{alloc,free}_buffer depend on CONFIG_DMA_DIRECT_OPS
    dma/swiotlb: Remove swiotlb_{alloc,free}_coherent()
    dma/direct: Handle force decryption for DMA coherent buffers in common code
    dma/direct: Handle the memory encryption bit in common code
    dma/swiotlb: Remove swiotlb_set_mem_attributes()
    set_memory.h: Provide set_memory_{en,de}crypted() stubs
    x86/dma: Remove dma_alloc_coherent_gfp_flags()
    iommu/intel-iommu: Enable CONFIG_DMA_DIRECT_OPS=y and clean up intel_{alloc,free}_coherent()
    iommu/amd_iommu: Use CONFIG_DMA_DIRECT_OPS=y and dma_direct_{alloc,free}()
    x86/dma/amd_gart: Use dma_direct_{alloc,free}()
    x86/dma/amd_gart: Look at dev->coherent_dma_mask instead of GFP_DMA
    x86/dma: Use generic swiotlb_ops
    x86/dma: Use DMA-direct (CONFIG_DMA_DIRECT_OPS=y)
    x86/dma: Remove dma_alloc_coherent_mask()

    Linus Torvalds
     

27 Mar, 2018

1 commit

  • dmi_get_bios_year() may return 0 when it cannot parse
    the BIOS date string. Previously this has been checked in
    pci_acpi_crs_quirks().

    Update the code to restore old behaviour.

    Reported-by: Jean Delvare
    Signed-off-by: Andy Shevchenko
    Reviewed-by: Jean Delvare
    Reviewed-by: Rafael J. Wysocki
    Acked-by: Thomas Gleixner
    Cc: Bjorn Helgaas
    Cc: Linus Torvalds
    Cc: Lukas Wunner
    Cc: Peter Zijlstra
    Cc: Rafael J . Wysocki
    Cc: linux-acpi@vger.kernel.org
    Cc: linux-pci@vger.kernel.org
    Fixes: 69c42d493db4 ("x86/pci: Simplify code by using the new dmi_get_bios_year() helper")
    Signed-off-by: Ingo Molnar

    Andy Shevchenko
     

20 Mar, 2018

3 commits

  • Give the basic phys_to_dma() and dma_to_phys() helpers a __-prefix and add
    the memory encryption mask to the non-prefixed versions. Use the
    __-prefixed versions directly instead of clearing the mask again in
    various places.

    Tested-by: Tom Lendacky
    Signed-off-by: Christoph Hellwig
    Reviewed-by: Thomas Gleixner
    Cc: David Woodhouse
    Cc: Joerg Roedel
    Cc: Jon Mason
    Cc: Konrad Rzeszutek Wilk
    Cc: Linus Torvalds
    Cc: Muli Ben-Yehuda
    Cc: Peter Zijlstra
    Cc: iommu@lists.linux-foundation.org
    Link: http://lkml.kernel.org/r/20180319103826.12853-13-hch@lst.de
    Signed-off-by: Ingo Molnar

    Christoph Hellwig
     
  • The generic swiotlb DMA ops were based on the x86 ones and provide
    equivalent functionality, so use them.

    Also fix the sta2x11 case. For that SOC the DMA map ops need an
    additional physical to DMA address translations. For swiotlb buffers
    that is done throught the phys_to_dma helper, but the sta2x11_dma_ops
    also added an additional translation on the return value from
    x86_swiotlb_alloc_coherent, which is only correct if that functions
    returns a direct allocation and not a swiotlb buffer. With the
    generic swiotlb and DMA-direct code phys_to_dma is not always used
    and the separate sta2x11_dma_ops can be replaced with a simple
    bit that marks if the additional physical to DMA address translation
    is needed.

    Tested-by: Tom Lendacky
    Signed-off-by: Christoph Hellwig
    Reviewed-by: Thomas Gleixner
    Cc: David Woodhouse
    Cc: Joerg Roedel
    Cc: Jon Mason
    Cc: Konrad Rzeszutek Wilk
    Cc: Linus Torvalds
    Cc: Muli Ben-Yehuda
    Cc: Peter Zijlstra
    Cc: iommu@lists.linux-foundation.org
    Link: http://lkml.kernel.org/r/20180319103826.12853-5-hch@lst.de
    Signed-off-by: Ingo Molnar

    Christoph Hellwig
     
  • The generic DMA-direct (CONFIG_DMA_DIRECT_OPS=y) implementation is now
    functionally equivalent to the x86 nommu dma_map implementation, so
    switch over to using it.

    That includes switching from using x86_dma_supported in various IOMMU
    drivers to use dma_direct_supported instead, which provides the same
    functionality.

    Tested-by: Tom Lendacky
    Signed-off-by: Christoph Hellwig
    Reviewed-by: Thomas Gleixner
    Cc: David Woodhouse
    Cc: Joerg Roedel
    Cc: Jon Mason
    Cc: Konrad Rzeszutek Wilk
    Cc: Linus Torvalds
    Cc: Muli Ben-Yehuda
    Cc: Peter Zijlstra
    Cc: iommu@lists.linux-foundation.org
    Link: http://lkml.kernel.org/r/20180319103826.12853-4-hch@lst.de
    Signed-off-by: Ingo Molnar

    Christoph Hellwig
     

08 Mar, 2018

2 commits

  • Use the PCI mmconfig base address exported by jailhouse in boot parameters
    in order to access the memory mapped PCI configuration space.

    [Jan: rebased, fixed !CONFIG_PCI_MMCONFIG, used pcibios_last_bus]

    Signed-off-by: Otavio Pontes
    Signed-off-by: Jan Kiszka
    Signed-off-by: Thomas Gleixner
    Reviewed-by: Andy Shevchenko
    Cc: jailhouse-dev@googlegroups.com
    Cc: linux-pci@vger.kernel.org
    Cc: virtualization@lists.linux-foundation.org
    Cc: Bjorn Helgaas
    Link: https://lkml.kernel.org/r/2ee9e4401fa22377b3965893a558120f169be82b.1520408357.git.jan.kiszka@siemens.com

    Otavio Pontes
     
  • Per PCIe r4.0, sec 7.5.1.1.9, multi-function devices are required to have a
    function 0. Therefore, Linux scans for devices at function 0 (devfn
    0/8/16/...) and only scans for other functions if function 0 has its
    Multi-Function Device bit set or ARI or SR-IOV indicate there are more
    functions.

    The Jailhouse hypervisor may pass individual functions of a multi-function
    device to a guest without passing function 0, which means a Linux guest
    won't find them.

    Change Linux PCI probing so it scans all function numbers when running as a
    guest over Jailhouse.

    This is technically prohibited by the spec, so it is possible that PCI
    devices without the Multi-Function Device bit set may have unexpected
    behavior in response to this probe.

    Originally-by: Benedikt Spranger
    Signed-off-by: Jan Kiszka
    Signed-off-by: Thomas Gleixner
    Reviewed-by: Andy Shevchenko
    Acked-by: Bjorn Helgaas
    Cc: jailhouse-dev@googlegroups.com
    Cc: Benedikt Spranger
    Cc: linux-pci@vger.kernel.org
    Cc: virtualization@lists.linux-foundation.org
    Link: https://lkml.kernel.org/r/06e279b2a3e06cf6689ab3975f8ab592bba02362.1520408357.git.jan.kiszka@siemens.com

    Jan Kiszka
     

23 Feb, 2018

1 commit

  • ...instead of open coding its functionality.

    No changes in functionality.

    Signed-off-by: Andy Shevchenko
    Cc: Bjorn Helgaas
    Cc: Jean Delvare
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Rafael J. Wysocki
    Cc: Thomas Gleixner
    Cc: linux-acpi@vger.kernel.org
    Cc: linux-pci@vger.kernel.org
    Link: http://lkml.kernel.org/r/20180222125923.57385-2-andriy.shevchenko@linux.intel.com
    Signed-off-by: Ingo Molnar

    Andy Shevchenko
     

07 Feb, 2018

1 commit

  • Pull PCI updates from Bjorn Helgaas:

    - skip AER driver error recovery callbacks for correctable errors
    reported via ACPI APEI, as we already do for errors reported via the
    native path (Tyler Baicar)

    - fix DPC shared interrupt handling (Alex Williamson)

    - print full DPC interrupt number (Keith Busch)

    - enable DPC only if AER is available (Keith Busch)

    - simplify DPC code (Bjorn Helgaas)

    - calculate ASPM L1 substate parameter instead of hardcoding it (Bjorn
    Helgaas)

    - enable Latency Tolerance Reporting for ASPM L1 substates (Bjorn
    Helgaas)

    - move ASPM internal interfaces out of public header (Bjorn Helgaas)

    - allow hot-removal of VGA devices (Mika Westerberg)

    - speed up unplug and shutdown by assuming Thunderbolt controllers
    don't support Command Completed events (Lukas Wunner)

    - add AtomicOps support for GPU and Infiniband drivers (Felix Kuehling,
    Jay Cornwall)

    - expose "ari_enabled" in sysfs to help NIC naming (Stuart Hayes)

    - clean up PCI DMA interface usage (Christoph Hellwig)

    - remove PCI pool API (replaced with DMA pool) (Romain Perier)

    - deprecate pci_get_bus_and_slot(), which assumed PCI domain 0 (Sinan
    Kaya)

    - move DT PCI code from drivers/of/ to drivers/pci/ (Rob Herring)

    - add PCI-specific wrappers for dev_info(), etc (Frederick Lawler)

    - remove warnings on sysfs mmap failure (Bjorn Helgaas)

    - quiet ROM validation messages (Alex Deucher)

    - remove redundant memory alloc failure messages (Markus Elfring)

    - fill in types for compile-time VGA and other I/O port resources
    (Bjorn Helgaas)

    - make "pci=pcie_scan_all" work for Root Ports as well as Downstream
    Ports to help AmigaOne X1000 (Bjorn Helgaas)

    - add SPDX tags to all PCI files (Bjorn Helgaas)

    - quirk Marvell 9128 DMA aliases (Alex Williamson)

    - quirk broken INTx disable on Ceton InfiniTV4 (Bjorn Helgaas)

    - fix CONFIG_PCI=n build by adding dummy pci_irqd_intx_xlate() (Niklas
    Cassel)

    - use DMA API to get MSI address for DesignWare IP (Niklas Cassel)

    - fix endpoint-mode DMA mask configuration (Kishon Vijay Abraham I)

    - fix ARTPEC-6 incorrect IS_ERR() usage (Wei Yongjun)

    - add support for ARTPEC-7 SoC (Niklas Cassel)

    - add endpoint-mode support for ARTPEC (Niklas Cassel)

    - add Cadence PCIe host and endpoint controller driver (Cyrille
    Pitchen)

    - handle multiple INTx status bits being set in dra7xx (Vignesh R)

    - translate dra7xx hwirq range to fix INTD handling (Vignesh R)

    - remove deprecated Exynos PHY initialization code (Jaehoon Chung)

    - fix MSI erratum workaround for HiSilicon Hip06/Hip07 (Dongdong Liu)

    - fix NULL pointer dereference in iProc BCMA driver (Ray Jui)

    - fix Keystone interrupt-controller-node lookup (Johan Hovold)

    - constify qcom driver structures (Julia Lawall)

    - rework Tegra config space mapping to increase space available for
    endpoints (Vidya Sagar)

    - simplify Tegra driver by using bus->sysdata (Manikanta Maddireddy)

    - remove PCI_REASSIGN_ALL_BUS usage on Tegra (Manikanta Maddireddy)

    - add support for Global Fabric Manager Server (GFMS) event to
    Microsemi Switchtec switch driver (Logan Gunthorpe)

    - add IDs for Switchtec PSX 24xG3 and PSX 48xG3 (Kelvin Cao)

    * tag 'pci-v4.16-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (140 commits)
    PCI: cadence: Add EndPoint Controller driver for Cadence PCIe controller
    dt-bindings: PCI: cadence: Add DT bindings for Cadence PCIe endpoint controller
    PCI: endpoint: Fix EPF device name to support multi-function devices
    PCI: endpoint: Add the function number as argument to EPC ops
    PCI: cadence: Add host driver for Cadence PCIe controller
    dt-bindings: PCI: cadence: Add DT bindings for Cadence PCIe host controller
    PCI: Add vendor ID for Cadence
    PCI: Add generic function to probe PCI host controllers
    PCI: generic: fix missing call of pci_free_resource_list()
    PCI: OF: Add generic function to parse and allocate PCI resources
    PCI: Regroup all PCI related entries into drivers/pci/Makefile
    PCI/DPC: Reformat DPC register definitions
    PCI/DPC: Add and use DPC Status register field definitions
    PCI/DPC: Squash dpc_rp_pio_get_info() into dpc_process_rp_pio_error()
    PCI/DPC: Remove unnecessary RP PIO register structs
    PCI/DPC: Push dpc->rp_pio_status assignment into dpc_rp_pio_get_info()
    PCI/DPC: Squash dpc_rp_pio_print_error() into dpc_rp_pio_get_info()
    PCI/DPC: Make RP PIO log size check more generic
    PCI/DPC: Rename local "status" to "dpc_status"
    PCI/DPC: Squash dpc_rp_pio_print_tlp_header() into dpc_rp_pio_print_error()
    ...

    Linus Torvalds
     

01 Feb, 2018

2 commits

  • Pull dma mapping updates from Christoph Hellwig:
    "Except for a runtime warning fix from Christian this is all about
    consolidation of the generic no-IOMMU code, a well as the glue code
    for swiotlb.

    All the code is based on the x86 implementation with hooks to allow
    all architectures that aren't cache coherent to use it.

    The x86 conversion itself has been deferred because the x86
    maintainers were a little busy in the last months"

    * tag 'dma-mapping-4.16' of git://git.infradead.org/users/hch/dma-mapping: (57 commits)
    MAINTAINERS: add the iommu list for swiotlb and xen-swiotlb
    arm64: use swiotlb_alloc and swiotlb_free
    arm64: replace ZONE_DMA with ZONE_DMA32
    mips: use swiotlb_{alloc,free}
    mips/netlogic: remove swiotlb support
    tile: use generic swiotlb_ops
    tile: replace ZONE_DMA with ZONE_DMA32
    unicore32: use generic swiotlb_ops
    ia64: remove an ifdef around the content of pci-dma.c
    ia64: clean up swiotlb support
    ia64: use generic swiotlb_ops
    ia64: replace ZONE_DMA with ZONE_DMA32
    swiotlb: remove various exports
    swiotlb: refactor coherent buffer allocation
    swiotlb: refactor coherent buffer freeing
    swiotlb: wire up ->dma_supported in swiotlb_dma_ops
    swiotlb: add common swiotlb_map_ops
    swiotlb: rename swiotlb_free to swiotlb_exit
    x86: rename swiotlb_dma_ops
    powerpc: rename swiotlb_dma_ops
    ...

    Linus Torvalds
     
  • * pci/virtualization:
    PCI: Expose ari_enabled in sysfs
    PCI: Add function 1 DMA alias quirk for Marvell 9128
    PCI: Mark Ceton InfiniTV4 INTx masking as broken
    xen/pci: Use acpi_noirq_set() helper to avoid #ifdef

    Bjorn Helgaas
     

30 Jan, 2018

1 commit

  • Pull x86 platform updates from Thomas Gleixner:
    "The platform support for x86 contains the following updates:

    - A set of updates for the UV platform to support new CPUs and to fix
    some of the UV4A BAU MRRs

    - The initial platform support for the jailhouse hypervisor to allow
    native Linux guests (inmates) in non-root cells.

    - A fix for the PCI initialization on Intel MID platforms"

    * 'x86-platform-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (24 commits)
    x86/jailhouse: Respect pci=lastbus command line settings
    x86/jailhouse: Set X86_FEATURE_TSC_KNOWN_FREQ
    x86/platform/intel-mid: Move PCI initialization to arch_init()
    x86/platform/uv/BAU: Replace hard-coded values with MMR definitions
    x86/platform/UV: Fix UV4A BAU MMRs
    x86/platform/UV: Fix GAM MMR references in the UV x2apic code
    x86/platform/UV: Fix GAM MMR changes in UV4A
    x86/platform/UV: Add references to access fixed UV4A HUB MMRs
    x86/platform/UV: Fix UV4A support on new Intel Processors
    x86/platform/UV: Update uv_mmrs.h to prepare for UV4A fixes
    x86/jailhouse: Add PCI dependency
    x86/jailhouse: Hide x2apic code when CONFIG_X86_X2APIC=n
    x86/jailhouse: Initialize PCI support
    x86/jailhouse: Wire up IOAPIC for legacy UART ports
    x86/jailhouse: Halt instead of failing to restart
    x86/jailhouse: Silence ACPI warning
    x86/jailhouse: Avoid access of unsupported platform resources
    x86/jailhouse: Set up timekeeping
    x86/jailhouse: Enable PMTIMER
    x86/jailhouse: Enable APIC and SMP support
    ...

    Linus Torvalds
     

19 Jan, 2018

1 commit

  • ACPI redefines x86_init.pci.init when enabled. Though we still need special
    treatment for MID platforms.

    Move our specific callback to x86_init.pci.arch_init() and, by calling
    acpi_noirq_set(), take back a control over IRQ assignment.

    Signed-off-by: Andy Shevchenko
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Rafael J. Wysocki
    Cc: Thomas Gleixner
    Cc: linux-acpi@vger.kernel.org
    Link: http://lkml.kernel.org/r/20180117173409.88136-2-andriy.shevchenko@linux.intel.com
    Signed-off-by: Ingo Molnar

    Andy Shevchenko
     

17 Jan, 2018

1 commit


12 Jan, 2018

3 commits

  • pci_get_bus_and_slot() is restrictive such that it assumes domain=0 as
    where a PCI device is present. This restricts the device drivers to be
    reused for other domain numbers.

    Getting ready to remove pci_get_bus_and_slot() function in favor of
    pci_get_domain_bus_and_slot().

    Use domain number of 0 as the domain number is not available in struct
    irq_routing_table.

    Signed-off-by: Sinan Kaya
    Signed-off-by: Bjorn Helgaas
    Acked-by: Thomas Gleixner

    Sinan Kaya
     
  • Avoid problems with BIOS implementations which don't report all used
    resources to the OS by only allocating a 256GB window directly below the
    hardware limit (from the BKDG, sec 2.4.6).

    Fixes a silent reboot loop reported by Aaro Koskinen
    on an AMD-based MSI MS-7699/760GA-P43(FX) system. This was apparently
    caused by RAM or other unreported hardware that conflicted with the new
    window.

    Link: https://support.amd.com/TechDocs/49125_15h_Models_30h-3Fh_BKDG.pdf
    Link: https://lkml.kernel.org/r/20180105220412.fzpwqe4zljdawr36@darkstar.musicnaut.iki.fi
    Fixes: fa564ad96366 ("x86/PCI: Enable a 64bit BAR on AMD Family 15h (Models 00-1f, 30-3f, 60-7f)")
    Reported-by: Aaro Koskinen
    Signed-off-by: Christian König
    [bhelgaas: changelog, comment, Fixes:]
    Signed-off-by: Bjorn Helgaas

    =?UTF-8?q?Christian=20K=C3=B6nig?=
     
  • Only try to enable a 64-bit window on AMD CPUs when "pci=big_root_window"
    is specified.

    This taints the kernel because the new 64-bit window uses address space we
    don't know anything about, and it may contain unreported devices or memory
    that would conflict with the window.

    The pci_amd_enable_64bit_bar() quirk that enables the window is specific to
    AMD CPUs. The generic solution would be to have the firmware enable the
    window and describe it in the host bridge's _CRS method, or at least
    describe it in the _PRS method so the OS would have the option of enabling
    it.

    Signed-off-by: Christian König
    [bhelgaas: changelog, extend doc, mention taint in dmesg]
    Signed-off-by: Bjorn Helgaas

    =?UTF-8?q?Christian=20K=C3=B6nig?=