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

  • Change tool compiling process in order to be build using the same
    mechanism used in other linux tools (e.g. iio, perf, etc). This will
    allow in future the buildroot tool to build and integrate this tool in
    a more expeditious way.

    Update documentation accordingly.

    Signed-off-by: Gustavo Pimentel
    Signed-off-by: Lorenzo Pieralisi
    Reviewed-by: Kishon Vijay Abraham I

    Gustavo Pimentel
     

27 Sep, 2018

1 commit

  • We don't need to be paranoid about the topology changing while handling an
    error. If the device has changed in a hotplug capable slot, we can rely on
    the presence detection handling to react to a changing topology.

    Restore the fatal error handling behavior that existed before merging DPC
    with AER with 7e9084b36740 ("PCI/AER: Handle ERR_FATAL with removal and
    re-enumeration of devices").

    Signed-off-by: Keith Busch
    Signed-off-by: Bjorn Helgaas
    Reviewed-by: Sinan Kaya

    Keith Busch
     

10 Sep, 2018

1 commit

  • This is a respin with a wider audience (all that get_maintainer returned)
    and I know this spams a *lot* of people. Not sure what would be the correct
    way, so my apologies for ruining your inbox.

    The 00-INDEX files are supposed to give a summary of all files present
    in a directory, but these files are horribly out of date and their
    usefulness is brought into question. Often a simple "ls" would reveal
    the same information as the filenames are generally quite descriptive as
    a short introduction to what the file covers (it should not surprise
    anyone what Documentation/sched/sched-design-CFS.txt covers)

    A few years back it was mentioned that these files were no longer really
    needed, and they have since then grown further out of date, so perhaps
    it is time to just throw them out.

    A short status yields the following _outdated_ 00-INDEX files, first
    counter is files listed in 00-INDEX but missing in the directory, last
    is files present but not listed in 00-INDEX.

    List of outdated 00-INDEX:
    Documentation: (4/10)
    Documentation/sysctl: (0/1)
    Documentation/timers: (1/0)
    Documentation/blockdev: (3/1)
    Documentation/w1/slaves: (0/1)
    Documentation/locking: (0/1)
    Documentation/devicetree: (0/5)
    Documentation/power: (1/1)
    Documentation/powerpc: (0/5)
    Documentation/arm: (1/0)
    Documentation/x86: (0/9)
    Documentation/x86/x86_64: (1/1)
    Documentation/scsi: (4/4)
    Documentation/filesystems: (2/9)
    Documentation/filesystems/nfs: (0/2)
    Documentation/cgroup-v1: (0/2)
    Documentation/kbuild: (0/4)
    Documentation/spi: (1/0)
    Documentation/virtual/kvm: (1/0)
    Documentation/scheduler: (0/2)
    Documentation/fb: (0/1)
    Documentation/block: (0/1)
    Documentation/networking: (6/37)
    Documentation/vm: (1/3)

    Then there are 364 subdirectories in Documentation/ with several files that
    are missing 00-INDEX alltogether (and another 120 with a single file and no
    00-INDEX).

    I don't really have an opinion to whether or not we /should/ have 00-INDEX,
    but the above 00-INDEX should either be removed or be kept up to date. If
    we should keep the files, I can try to keep them updated, but I rather not
    if we just want to delete them anyway.

    As a starting point, remove all index-files and references to 00-INDEX and
    see where the discussion is going.

    Signed-off-by: Henrik Austad
    Acked-by: "Paul E. McKenney"
    Just-do-it-by: Steven Rostedt
    Reviewed-by: Jens Axboe
    Acked-by: Paul Moore
    Acked-by: Greg Kroah-Hartman
    Acked-by: Mark Brown
    Acked-by: Mike Rapoport
    Cc: [Almost everybody else]
    Signed-off-by: Jonathan Corbet

    Henrik Austad
     

16 Aug, 2018

2 commits

  • - Add Kirin MSI support (Xiaowei Song)

    - Drop unnecessary root_bus_nr setting from exynos, imx6, keystone,
    armada8k, artpec6, designware-plat, histb, qcom, spear13xx (Shawn Guo)

    - Move link notification settings from DesignWare core to individual
    drivers (Gustavo Pimentel)

    - Add endpoint library MSI-X interfaces (Gustavo Pimentel)

    - Correct signature of endpoint library IRQ interfaces (Gustavo Pimentel)

    - Add DesignWare endpoint library MSI-X callbacks (Gustavo Pimentel)

    - Add endpoint library MSI-X test support (Gustavo Pimentel)

    * remotes/lorenzo/pci/dwc:
    PCI: endpoint: Add MSI set maximum restriction
    tools: PCI: Add MSI-X support
    pci_endpoint_test: Add 2 ioctl commands
    pci-epf-test/pci_endpoint_test: Add MSI-X support
    pci-epf-test/pci_endpoint_test: Use irq_type module parameter
    pci-epf-test/pci_endpoint_test: Cleanup PCI_ENDPOINT_TEST memspace
    PCI: dwc: Add legacy interrupt callback handler
    PCI: dwc: Rework MSI callbacks handler
    PCI: dwc: Add MSI-X callbacks handler
    PCI: Update xxx_pcie_ep_raise_irq() and pci_epc_raise_irq() signatures
    PCI: endpoint: Add MSI-X interfaces
    PCI: dwc: Fix EP link notification implementation
    PCI: spear13xx: Drop unnecessary root_bus_nr setting
    PCI: qcom: Drop unnecessary root_bus_nr setting
    PCI: histb: Drop unnecessary root_bus_nr setting
    PCI: designware-plat: Drop unnecessary root_bus_nr setting
    PCI: artpec6: Drop unnecessary root_bus_nr setting
    PCI: armada8k: Drop unnecessary root_bus_nr setting
    PCI: keystone: Drop unnecessary root_bus_nr setting
    PCI: imx6: Drop unnecessary root_bus_nr setting
    PCI: exynos: Drop unnecessary root_bus_nr setting
    PCI: kirin: Add MSI support

    Bjorn Helgaas
     
  • - Document ACPI description of PCI host bridges (Bjorn Helgaas)

    * pci/notes:
    PCI: Document ACPI description of PCI host bridges

    Bjorn Helgaas
     

28 Jul, 2018

1 commit


20 Jul, 2018

1 commit


19 Jul, 2018

4 commits


18 May, 2018

1 commit

  • PCIe ERR_FATAL errors mean the Link is unreliable. Components on the Link
    may need to be reset to return to reliable operation (PCIe r4.0, sec
    6.2.2). We previously handled these errors much differently depending on
    whether the platform supports Downstream Port Containment (DPC) (PCIe r4.0,
    sec 6.2.10) or not.

    The AER driver has historically logged the error details, called
    driver-supplied pci_error_handlers callbacks, and reset the Link. This
    reset downstream devices, but did not remove them from the PCI subsystem,
    re-enumerate them, or call their driver .remove() or .probe() methods.

    DPC is different because the hardware automatically disables the Link when
    it detects ERR_FATAL, which resets downstream devices. There's no
    opportunity for pci_error_handlers callbacks before resetting the Link.
    The DPC driver removes affected devices (which calls their driver .remove()
    methods), brings the Link back up, and re-enumerates (which calls driver
    .probe() methods).

    Align AER ERR_FATAL handling with DPC by resetting the Link in software,
    skipping the driver pci_error_handlers callbacks, removing the devices from
    the PCI subsystem, and re-enumerating. The idea is that drivers and
    devices should see the same behavior for ERR_FATAL events, regardless of
    whether they're handled by AER or DPC.

    Here are the basic ERR_FATAL recovery steps, showing the previous AER
    behavior, the AER behavior after this patch, and the DPC behavior:

    AER AER DPC
    previous new behavior
    -------- --- --------
    Log error yes yes yes (minimal)
    drv.error_detected() yes no no
    Reset Link yes yes yes
    drv.mmio_enabled() yes no no
    drv.slot_reset() yes no no
    drv.resume() yes no no
    Remove PCI devices no yes yes
    (calls drv.remove())
    Re-enumerate no yes yes
    (calls drv.probe())

    N.B. With DPC, the Link reset happens before the driver .remove() calls,
    while with AER, the reset happens *after* the .remove() calls. The goal is
    to eventually do the reset before .remove() for AER as well.

    Signed-off-by: Oza Pawandeep
    [bhelgaas: changelog, squash doc patch into this, remove unused
    "result_data"]
    Signed-off-by: Bjorn Helgaas
    Reviewed-by: Keith Busch

    Oza Pawandeep
     

23 Feb, 2018

1 commit


16 May, 2017

1 commit


09 May, 2017

1 commit

  • Pull PCI updates from Bjorn Helgaas:

    - add framework for supporting PCIe devices in Endpoint mode (Kishon
    Vijay Abraham I)

    - use non-postable PCI config space mappings when possible (Lorenzo
    Pieralisi)

    - clean up and unify mmap of PCI BARs (David Woodhouse)

    - export and unify Function Level Reset support (Christoph Hellwig)

    - avoid FLR for Intel 82579 NICs (Sasha Neftin)

    - add pci_request_irq() and pci_free_irq() helpers (Christoph Hellwig)

    - short-circuit config access failures for disconnected devices (Keith
    Busch)

    - remove D3 sleep delay when possible (Adrian Hunter)

    - freeze PME scan before suspending devices (Lukas Wunner)

    - stop disabling MSI/MSI-X in pci_device_shutdown() (Prarit Bhargava)

    - disable boot interrupt quirk for ASUS M2N-LR (Stefan Assmann)

    - add arch-specific alignment control to improve device passthrough by
    avoiding multiple BARs in a page (Yongji Xie)

    - add sysfs sriov_drivers_autoprobe to control VF driver binding
    (Bodong Wang)

    - allow slots below PCI-to-PCIe "reverse bridges" (Bjorn Helgaas)

    - fix crashes when unbinding host controllers that don't support
    removal (Brian Norris)

    - add driver for MicroSemi Switchtec management interface (Logan
    Gunthorpe)

    - add driver for Faraday Technology FTPCI100 host bridge (Linus
    Walleij)

    - add i.MX7D support (Andrey Smirnov)

    - use generic MSI support for Aardvark (Thomas Petazzoni)

    - make Rockchip driver modular (Brian Norris)

    - advertise 128-byte Read Completion Boundary support for Rockchip
    (Shawn Lin)

    - advertise PCI_EXP_LNKSTA_SLC for Rockchip root port (Shawn Lin)

    - convert atomic_t to refcount_t in HV driver (Elena Reshetova)

    - add CPU IRQ affinity in HV driver (K. Y. Srinivasan)

    - fix PCI bus removal in HV driver (Long Li)

    - add support for ThunderX2 DMA alias topology (Jayachandran C)

    - add ThunderX pass2.x 2nd node MCFG quirk (Tomasz Nowicki)

    - add ITE 8893 bridge DMA alias quirk (Jarod Wilson)

    - restrict Cavium ACS quirk only to CN81xx/CN83xx/CN88xx devices
    (Manish Jaggi)

    * tag 'pci-v4.12-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (146 commits)
    PCI: Don't allow unbinding host controllers that aren't prepared
    ARM: DRA7: clockdomain: Change the CLKTRCTRL of CM_PCIE_CLKSTCTRL to SW_WKUP
    MAINTAINERS: Add PCI Endpoint maintainer
    Documentation: PCI: Add userguide for PCI endpoint test function
    tools: PCI: Add sample test script to invoke pcitest
    tools: PCI: Add a userspace tool to test PCI endpoint
    Documentation: misc-devices: Add Documentation for pci-endpoint-test driver
    misc: Add host side PCI driver for PCI test function device
    PCI: Add device IDs for DRA74x and DRA72x
    dt-bindings: PCI: dra7xx: Add DT bindings to enable unaligned access
    PCI: dwc: dra7xx: Workaround for errata id i870
    dt-bindings: PCI: dra7xx: Add DT bindings for PCI dra7xx EP mode
    PCI: dwc: dra7xx: Add EP mode support
    PCI: dwc: dra7xx: Facilitate wrapper and MSI interrupts to be enabled independently
    dt-bindings: PCI: Add DT bindings for PCI designware EP mode
    PCI: dwc: designware: Add EP mode support
    Documentation: PCI: Add binding documentation for pci-test endpoint function
    ixgbe: Use pcie_flr() instead of duplicating it
    IB/hfi1: Use pcie_flr() instead of duplicating it
    PCI: imx6: Fix spelling mistake: "contol" -> "control"
    ...

    Linus Torvalds
     

28 Apr, 2017

3 commits


20 Apr, 2017

1 commit

  • Sometimes it is not desirable to bind SR-IOV VFs to drivers. This can save
    host side resource usage by VF instances that will be assigned to VMs.

    Add a new PCI sysfs interface "sriov_drivers_autoprobe" to control that
    from the PF. To modify it, echo 0/n/N (disable probe) or 1/y/Y (enable
    probe) to:

    /sys/bus/pci/devices//sriov_drivers_autoprobe

    Note that this must be done before enabling VFs. The change will not take
    effect if VFs are already enabled. Simply, one can disable VFs by setting
    sriov_numvfs to 0, choose whether to probe or not, and then re-enable the
    VFs by restoring sriov_numvfs.

    [bhelgaas: changelog, ABI doc]
    Signed-off-by: Bodong Wang
    Signed-off-by: Eli Cohen
    Signed-off-by: Bjorn Helgaas
    Reviewed-by: Gavin Shan
    Reviewed-by: Alex Williamson

    Bodong Wang
     

12 Apr, 2017

3 commits


30 Mar, 2017

1 commit


05 Mar, 2017

1 commit

  • Pull documentation fixes from Jonathan Corbet:
    "A few fixes for the docs tree, including one for a 4.11 build
    regression"

    * tag 'docs-4.11-fixes' of git://git.lwn.net/linux:
    Documentation/sphinx: fix primary_domain configuration
    docs: Fix htmldocs build failure
    doc/ko_KR/memory-barriers: Update control-dependencies section
    pcieaer doc: update the link
    Documentation: Update path to sysrq.txt

    Linus Torvalds
     

04 Mar, 2017

1 commit


16 Feb, 2017

3 commits

  • * pci/msi:
    PCI/MSI: Update MSI/MSI-X bits in PCIEBUS-HOWTO
    PCI/MSI: Document pci_alloc_irq_vectors(), deprecate pci_enable_msi()
    PCI/MSI: Return -ENOSPC if pci_enable_msi_range() can't get enough vectors
    PCI/portdrv: Use pci_irq_alloc_vectors()
    PCI/MSI: Check that we have a legacy interrupt line before using it
    PCI/MSI: Remove pci_msi_domain_{alloc,free}_irqs()
    PCI/MSI: Remove unused pci_msi_create_default_irq_domain()
    PCI/MSI: Return failure when msix_setup_entries() fails
    PCI/MSI: Remove pci_enable_msi_{exact,range}()
    amd-xgbe: Update PCI support to use new IRQ functions
    [media] cobalt: use pci_irq_allocate_vectors()
    PCI/MSI: Fix msi_capability_init() kernel-doc warnings

    Bjorn Helgaas
     
  • Update the MSI/MSI-X bits in PCIEBUS-HOWTO. Stop talking about low-level
    details that mention deprecated APIs and concentrate on what service
    drivers should do and why.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Bjorn Helgaas

    Christoph Hellwig
     
  • Document pci_alloc_irq_vectors() instead of the deprecated pci_enable_msi()
    and pci_enable_msix() APIs.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Bjorn Helgaas

    Christoph Hellwig
     

10 Feb, 2017

1 commit

  • No hardware seems to actually call .link_reset(), and no driver implements
    it as more than a nop stub.

    Drop mentions of the callback from everywhere. It's dropped from the
    documentation as well, but the doc really needs to be updated to reflect
    reality better (e.g., on PCIe, slot reset is the link reset). This will be
    done in a later patch.

    Signed-off-by: Michael S. Tsirkin
    Signed-off-by: Bjorn Helgaas

    Michael S. Tsirkin
     

14 Jan, 2017

1 commit


08 Oct, 2016

1 commit

  • Pull PCI updates from Bjorn Helgaas:
    "Summary of PCI changes for the v4.9 merge window:

    Enumeration:
    - microblaze: Add multidomain support for procfs (Bharat Kumar Gogada)

    Resource management:
    - Ignore requested alignment for PROBE_ONLY and fixed resources (Yongji Xie)
    - Ignore requested alignment for VF BARs (Yongji Xie)

    PCI device hotplug:
    - Make core explicitly non-modular (Paul Gortmaker)

    PCIe native device hotplug:
    - Rename pcie_isr() locals for clarity (Bjorn Helgaas)
    - Return IRQ_NONE when we can't read interrupt status (Bjorn Helgaas)
    - Remove unnecessary guard (Bjorn Helgaas)
    - Clean up dmesg "Slot(%s)" messages (Bjorn Helgaas)
    - Remove useless pciehp_get_latch_status() calls (Bjorn Helgaas)
    - Clear attention LED on device add (Keith Busch)
    - Allow exclusive userspace control of indicators (Keith Busch)
    - Process all hotplug events before looking for new ones (Mayurkumar Patel)
    - Don't re-read Slot Status when queuing hotplug event (Mayurkumar Patel)
    - Don't re-read Slot Status when handling surprise event (Mayurkumar Patel)
    - Make explicitly non-modular (Paul Gortmaker)

    Power management:
    - Afford direct-complete to devices with non-standard PM (Lukas Wunner)
    - Query platform firmware for device power state (Lukas Wunner)
    - Recognize D3cold in pci_update_current_state() (Lukas Wunner)
    - Avoid unnecessary resume after direct-complete (Lukas Wunner)
    - Make explicitly non-modular (Paul Gortmaker)

    Virtualization:
    - Mark Atheros AR9580 to avoid bus reset (Maik Broemme)
    - Check for pci_setup_device() failure in pci_iov_add_virtfn() (Po Liu)

    MSI:
    - Enable PCI_MSI_IRQ_DOMAIN support for ARC (Joao Pinto)

    AER:
    - Remove aerdriver.nosourceid kernel parameter (Bjorn Helgaas)
    - Remove aerdriver.forceload kernel parameter (Bjorn Helgaas)
    - Fix aer_probe() kernel-doc comment (Cao jin)
    - Add bus flag to skip source ID matching (Jon Derrick)
    - Avoid memory allocation in interrupt handling path (Jon Derrick)
    - Cache capability position (Keith Busch)
    - Make explicitly non-modular (Paul Gortmaker)
    - Remove duplicate AER severity translation (Tyler Baicar)
    - Send correct severity to calculate AER severity (Tyler Baicar)

    Precision Time Measurement:
    - Add Precision Time Measurement (PTM) support (Jonathan Yong)
    - Add PTM clock granularity information (Bjorn Helgaas)
    - Add pci_enable_ptm() for drivers to enable PTM on endpoints (Bjorn Helgaas)

    Generic host bridge driver:
    - Fix pci_remap_iospace() failure path (Lorenzo Pieralisi)
    - Make explicitly non-modular (Paul Gortmaker)

    Altera host bridge driver:
    - Remove redundant platform_get_resource() return value check (Bjorn Helgaas)
    - Poll for link training status after retraining the link (Ley Foon Tan)
    - Rework config accessors for use without a struct pci_bus (Ley Foon Tan)
    - Move retrain from fixup to altera_pcie_host_init() (Ley Foon Tan)
    - Make MSI explicitly non-modular (Paul Gortmaker)
    - Make explicitly non-modular (Paul Gortmaker)
    - Relax device number checking to allow SR-IOV (Po Liu)

    ARM Versatile host bridge driver:
    - Fix pci_remap_iospace() failure path (Lorenzo Pieralisi)

    Axis ARTPEC-6 host bridge driver:
    - Drop __init from artpec6_add_pcie_port() (Niklas Cassel)

    Freescale i.MX6 host bridge driver:
    - Make explicitly non-modular (Paul Gortmaker)

    Intel VMD host bridge driver:
    - Add quirk for AER to ignore source ID (Jon Derrick)
    - Allocate IRQ lists with correct MSI-X count (Jon Derrick)
    - Convert to use pci_alloc_irq_vectors() API (Jon Derrick)
    - Eliminate vmd_vector member from list type (Jon Derrick)
    - Eliminate index member from IRQ list (Jon Derrick)
    - Synchronize with RCU freeing MSI IRQ descs (Keith Busch)
    - Request userspace control of PCIe hotplug indicators (Keith Busch)
    - Move VMD driver to drivers/pci/host (Keith Busch)

    Marvell Aardvark host bridge driver:
    - Fix pci_remap_iospace() failure path (Lorenzo Pieralisi)
    - Remove redundant dev_err call in advk_pcie_probe() (Wei Yongjun)

    Microsoft Hyper-V host bridge driver:
    - Use zero-length array in struct pci_packet (Dexuan Cui)
    - Use pci_function_description[0] in struct definitions (Dexuan Cui)
    - Remove the unused 'wrk' in struct hv_pcibus_device (Dexuan Cui)
    - Handle vmbus_sendpacket() failure in hv_compose_msi_msg() (Dexuan Cui)
    - Handle hv_pci_generic_compl() error case (Dexuan Cui)
    - Use list_move_tail() instead of list_del() + list_add_tail() (Wei Yongjun)

    NVIDIA Tegra host bridge driver:
    - Fix pci_remap_iospace() failure path (Lorenzo Pieralisi)
    - Remove redundant _data suffix (Thierry Reding)
    - Use of_device_get_match_data() (Thierry Reding)

    Qualcomm host bridge driver:
    - Make explicitly non-modular (Paul Gortmaker)

    Renesas R-Car host bridge driver:
    - Consolidate register space lookup and ioremap (Bjorn Helgaas)
    - Don't disable/unprepare clocks on prepare/enable failure (Geert Uytterhoeven)
    - Add multi-MSI support (Grigory Kletsko)
    - Fix pci_remap_iospace() failure path (Lorenzo Pieralisi)
    - Fix some checkpatch warnings (Sergei Shtylyov)
    - Try increasing PCIe link speed to 5 GT/s at boot (Sergei Shtylyov)

    Rockchip host bridge driver:
    - Add DT bindings for Rockchip PCIe controller (Shawn Lin)
    - Add Rockchip PCIe controller support (Shawn Lin)
    - Improve the deassert sequence of four reset pins (Shawn Lin)
    - Fix wrong transmitted FTS count (Shawn Lin)
    - Increase the Max Credit update interval (Rajat Jain)

    Samsung Exynos host bridge driver:
    - Make explicitly non-modular (Paul Gortmaker)

    ST Microelectronics SPEAr13xx host bridge driver:
    - Make explicitly non-modular (Paul Gortmaker)

    Synopsys DesignWare host bridge driver:
    - Return data directly from dw_pcie_readl_rc() (Bjorn Helgaas)
    - Exchange viewport of `MEMORYs' and `CFGs/IOs' (Dong Bo)
    - Check LTSSM training bit before deciding link is up (Jisheng Zhang)
    - Move link wait definitions to .c file (Joao Pinto)
    - Wait for iATU enable (Joao Pinto)
    - Add iATU Unroll feature (Joao Pinto)
    - Fix pci_remap_iospace() failure path (Lorenzo Pieralisi)
    - Make explicitly non-modular (Paul Gortmaker)
    - Relax device number checking to allow SR-IOV (Po Liu)
    - Keep viewport fixed for IO transaction if num_viewport > 2 (Pratyush Anand)
    - Remove redundant platform_get_resource() return value check (Wei Yongjun)

    TI DRA7xx host bridge driver:
    - Make explicitly non-modular (Paul Gortmaker)

    TI Keystone host bridge driver:
    - Propagate request_irq() failure (Wei Yongjun)

    Xilinx AXI host bridge driver:
    - Keep both legacy and MSI interrupt domain references (Bharat Kumar Gogada)
    - Clear interrupt register for invalid interrupt (Bharat Kumar Gogada)
    - Clear correct MSI set bit (Bharat Kumar Gogada)
    - Dispose of MSI virtual IRQ (Bharat Kumar Gogada)
    - Make explicitly non-modular (Paul Gortmaker)
    - Relax device number checking to allow SR-IOV (Po Liu)

    Xilinx NWL host bridge driver:
    - Expand error logging (Bharat Kumar Gogada)
    - Enable all MSI interrupts using MSI mask (Bharat Kumar Gogada)
    - Make explicitly non-modular (Paul Gortmaker)

    Miscellaneous:
    - Drop CONFIG_KEXEC_CORE ifdeffery (Lukas Wunner)
    - portdrv: Make explicitly non-modular (Paul Gortmaker)
    - Make DPC explicitly non-modular (Paul Gortmaker)"

    * tag 'pci-v4.9-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (105 commits)
    x86/PCI: VMD: Move VMD driver to drivers/pci/host
    PCI: rockchip: Fix wrong transmitted FTS count
    PCI: rockchip: Improve the deassert sequence of four reset pins
    PCI: rockchip: Increase the Max Credit update interval
    PCI: rcar: Try increasing PCIe link speed to 5 GT/s at boot
    PCI/AER: Fix aer_probe() kernel-doc comment
    PCI: Ignore requested alignment for VF BARs
    PCI: Ignore requested alignment for PROBE_ONLY and fixed resources
    PCI: Avoid unnecessary resume after direct-complete
    PCI: Recognize D3cold in pci_update_current_state()
    PCI: Query platform firmware for device power state
    PCI: Afford direct-complete to devices with non-standard PM
    PCI/AER: Cache capability position
    PCI/AER: Avoid memory allocation in interrupt handling path
    x86/PCI: VMD: Request userspace control of PCIe hotplug indicators
    PCI: pciehp: Allow exclusive userspace control of indicators
    ACPI / APEI: Send correct severity to calculate AER severity
    PCI/AER: Remove duplicate AER severity translation
    x86/PCI: VMD: Synchronize with RCU freeing MSI IRQ descs
    x86/PCI: VMD: Eliminate index member from IRQ list
    ...

    Linus Torvalds
     

06 Oct, 2016

1 commit

  • * pci/host-vmd:
    x86/PCI: VMD: Move VMD driver to drivers/pci/host
    x86/PCI: VMD: Synchronize with RCU freeing MSI IRQ descs
    x86/PCI: VMD: Eliminate index member from IRQ list
    x86/PCI: VMD: Eliminate vmd_vector member from list type
    x86/PCI: VMD: Convert to use pci_alloc_irq_vectors() API
    x86/PCI: VMD: Allocate IRQ lists with correct MSI-X count
    PCI: Use positive flags in pci_alloc_irq_vectors()
    PCI: Update "pci=resource_alignment" documentation

    Conflicts:
    drivers/pci/host/Kconfig
    drivers/pci/host/Makefile

    Bjorn Helgaas
     

15 Sep, 2016

2 commits

  • Per the PCI Firmware spec, r3.0, sec 4.5.1, on ACPI systems, the OS must
    not use AER unless _OSC is present and _OSC grants AER control to the OS.
    The aerdriver.forceload kernel parameter was a way to enable Linux AER
    support on ACPI systems that lack _OSC or fail to grant control the the OS.

    Enabling Linux AER support when the firmware doesn't want us to is a recipe
    for problems, e.g., the firmware might be handling AER itself.

    Remove the aerdriver.forceload kernel parameter and related supporting
    code.

    Signed-off-by: Bjorn Helgaas

    Bjorn Helgaas
     
  • The aerdriver.nosourceid kernel parameter was intended for working around
    broken chipsets don't supply the source ID for AER events. We recently
    added PCI_BUS_FLAGS_NO_AERSID, which can be set by quirks for the same
    purpose.

    Remove the aerdriver.nosourceid kernel parameter. For anything other than
    debugging, asking users to find and use kernel parameters is a poor user
    experience. Instead, we should add PCI_BUS_FLAGS_NO_AERSID quirks for any
    hardware that needs it.

    Signed-off-by: Bjorn Helgaas

    Bjorn Helgaas
     

02 Sep, 2016

1 commit


17 Aug, 2016

1 commit

  • Instead of passing negative flags like PCI_IRQ_NOMSI to prevent use of
    certain interrupt types, pass positive flags like PCI_IRQ_LEGACY,
    PCI_IRQ_MSI, etc., to specify the acceptable interrupt types.

    This is based on a number of pending driver conversions that just happend
    to be a whole more obvious to read this way, and given that we have no
    users in the tree yet it can still easily be done.

    I've also added a PCI_IRQ_ALL_TYPES catchall to keep the case of accepting
    all interrupt types very simple.

    [bhelgaas: changelog, fix PCI_IRQ_AFFINITY doc typo, remove mention of
    PCI_IRQ_NOLEGACY]
    Signed-off-by: Christoph Hellwig
    Signed-off-by: Bjorn Helgaas
    Reviewed-by: Alexander Gordeev

    Christoph Hellwig
     

22 Jul, 2016

2 commits

  • Set the affinity_mask in the PCI device before allocating vectors so that
    the affinity can be propagated through the MSI descriptor structures to the
    core IRQ code. To facilitate this, new __pci_enable_msi_range() and
    __pci_enable_msix_range() helpers are factored out of their not prefixed
    variants which assigning the new IRQ affinity mask in the PCI device so
    that the low-level interrupt code can perform the interrupt affinity
    assignment and do node-local allocations.

    A new PCI_IRQ_NOAFFINITY flag is added to pci_alloc_irq_vectors() so that
    this function can also be used by drivers that don't wish to use the
    automatic affinity assignment.

    [bhelgaas: omit "else" after "return" consistently]
    Signed-off-by: Christoph Hellwig
    Signed-off-by: Bjorn Helgaas
    Reviewed-by: Alexander Gordeev

    Christoph Hellwig
     
  • Add a function to allocate and free a range of interrupt vectors, using
    MSI-X, MSI or legacy vectors (in that order) based on the capabilities of
    the underlying device and PCIe complex.

    Additionally a new helper is provided to get the Linux IRQ number for given
    device-relative vector so that the drivers don't need to allocate their own
    arrays to keep track of the vectors for the multi vector MSI-X case.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Bjorn Helgaas
    Reviewed-by: Alexander Gordeev

    Christoph Hellwig