22 Jan, 2016

1 commit

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

    Enumeration:
    - Simplify config space size computation (Bjorn Helgaas)
    - Avoid iterating through ROM outside the resource window (Edward O'Callaghan)
    - Support PCIe devices with short cfg_size (Jason S. McMullan)
    - Add Netronome vendor and device IDs (Jason S. McMullan)
    - Limit config space size for Netronome NFP6000 family (Jason S. McMullan)
    - Add Netronome NFP4000 PF device ID (Simon Horman)
    - Limit config space size for Netronome NFP4000 (Simon Horman)
    - Print warnings for all invalid expansion ROM headers (Vladis Dronov)

    Resource management:
    - Fix minimum allocation address overwrite (Christoph Biedl)

    PCI device hotplug:
    - acpiphp_ibm: Fix null dereferences on null ibm_slot (Colin Ian King)
    - pciehp: Always protect pciehp_disable_slot() with hotplug mutex (Guenter Roeck)
    - shpchp: Constify hpc_ops structure (Julia Lawall)
    - ibmphp: Remove unneeded NULL test (Julia Lawall)

    Power management:
    - Make ASPM sysfs link_state_store() consistent with link_state_show() (Andy Lutomirski)

    Virtualization
    - Add function 1 DMA alias quirk for Lite-On/Plextor M6e/Marvell 88SS9183 (Tim Sander)

    MSI:
    - Remove empty pci_msi_init_pci_dev() (Bjorn Helgaas)
    - Mark PCIe/PCI (MSI) IRQ cascade handlers as IRQF_NO_THREAD (Grygorii Strashko)
    - Initialize MSI capability for all architectures (Guilherme G. Piccoli)
    - Relax msi_domain_alloc() to support parentless MSI irqdomains (Liu Jiang)

    ARM Versatile host bridge driver:
    - Remove unused pci_sys_data structures (Lorenzo Pieralisi)

    Broadcom iProc host bridge driver:
    - Hide CONFIG_PCIE_IPROC (Arnd Bergmann)
    - Do not use 0x in front of %pap (Dmitry V. Krivenok)
    - Update iProc PCIe device tree binding (Ray Jui)
    - Add PAXC interface support (Ray Jui)
    - Add iProc PCIe MSI device tree binding (Ray Jui)
    - Add iProc PCIe MSI support (Ray Jui)

    Freescale i.MX6 host bridge driver:
    - Use gpio_set_value_cansleep() (Fabio Estevam)
    - Add support for active-low reset GPIO (Petr Štetiar)

    HiSilicon host bridge driver:
    - Add support for HiSilicon Hip06 PCIe host controllers (Gabriele Paoloni)

    Intel VMD host bridge driver:
    - Export irq_domain_set_info() for module use (Keith Busch)
    - x86/PCI: Allow DMA ops specific to a PCI domain (Keith Busch)
    - Use 32 bit PCI domain numbers (Keith Busch)
    - Add driver for Intel Volume Management Device (VMD) (Keith Busch)

    Qualcomm host bridge driver:
    - Document PCIe devicetree bindings (Stanimir Varbanov)
    - Add Qualcomm PCIe controller driver (Stanimir Varbanov)
    - dts: apq8064: add PCIe devicetree node (Stanimir Varbanov)
    - dts: ifc6410: enable PCIe DT node for this board (Stanimir Varbanov)

    Renesas R-Car host bridge driver:
    - Add support for R-Car H3 to pcie-rcar (Harunobu Kurokawa)
    - Allow DT to override default window settings (Phil Edworthy)
    - Convert to DT resource parsing API (Phil Edworthy)
    - Revert "PCI: rcar: Build pcie-rcar.c only on ARM" (Phil Edworthy)
    - Remove unused pci_sys_data struct from pcie-rcar (Phil Edworthy)
    - Add runtime PM support to pcie-rcar (Phil Edworthy)
    - Add Gen2 PHY setup to pcie-rcar (Phil Edworthy)
    - Add gen2 fallback compatibility string for pci-rcar-gen2 (Simon Horman)
    - Add gen2 fallback compatibility string for pcie-rcar (Simon Horman)

    Synopsys DesignWare host bridge driver:
    - Simplify control flow (Bjorn Helgaas)
    - Make config accessor override checking symmetric (Bjorn Helgaas)
    - Ensure ATU is enabled before IO/conf space accesses (Stanimir Varbanov)

    Miscellaneous:
    - Add of_pci_get_host_bridge_resources() stub (Arnd Bergmann)
    - Check for PCI_HEADER_TYPE_BRIDGE equality, not bitmask (Bjorn Helgaas)
    - Fix all whitespace issues (Bogicevic Sasa)
    - x86/PCI: Simplify pci_bios_{read,write} (Geliang Tang)
    - Use to_pci_dev() instead of open-coding it (Geliang Tang)
    - Use kobj_to_dev() instead of open-coding it (Geliang Tang)
    - Use list_for_each_entry() to simplify code (Geliang Tang)
    - Fix typos in (Thomas Petazzoni)
    - x86/PCI: Clarify AMD Fam10h config access restrictions comment (Tomasz Nowicki)"

    * tag 'pci-v4.5-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (58 commits)
    PCI: Add function 1 DMA alias quirk for Lite-On/Plextor M6e/Marvell 88SS9183
    PCI: Limit config space size for Netronome NFP4000
    PCI: Add Netronome NFP4000 PF device ID
    x86/PCI: Add driver for Intel Volume Management Device (VMD)
    PCI/AER: Use 32 bit PCI domain numbers
    x86/PCI: Allow DMA ops specific to a PCI domain
    irqdomain: Export irq_domain_set_info() for module use
    PCI: host: Add of_pci_get_host_bridge_resources() stub
    genirq/MSI: Relax msi_domain_alloc() to support parentless MSI irqdomains
    PCI: rcar: Add Gen2 PHY setup to pcie-rcar
    PCI: rcar: Add runtime PM support to pcie-rcar
    PCI: designware: Make config accessor override checking symmetric
    PCI: ibmphp: Remove unneeded NULL test
    ARM: dts: ifc6410: enable PCIe DT node for this board
    ARM: dts: apq8064: add PCIe devicetree node
    PCI: hotplug: Use list_for_each_entry() to simplify code
    PCI: rcar: Remove unused pci_sys_data struct from pcie-rcar
    PCI: hisi: Add support for HiSilicon Hip06 PCIe host controllers
    PCI: Avoid iterating through memory outside the resource window
    PCI: acpiphp_ibm: Fix null dereferences on null ibm_slot
    ...

    Linus Torvalds
     

09 Dec, 2015

1 commit


01 Dec, 2015

1 commit


26 Nov, 2015

1 commit

  • Commit b3a72384fe29 ("ARM/PCI: Replace pci_sys_data->align_resource with
    global function pointer") introduced an ARM-specific align_resource()
    function pointer. This is not portable to other arches and doesn't work
    for platforms with two different PCIe host bridge controllers.

    Move the function pointer to the pci_host_bridge structure so each host
    bridge driver can specify its own align_resource() function.

    Signed-off-by: Gabriele Paoloni
    Signed-off-by: Bjorn Helgaas
    Reviewed-by: Arnd Bergmann

    Gabriele Paoloni
     

07 Nov, 2015

1 commit

  • Pull PCI updates from Bjorn Helgaas:
    "Resource management:
    - Add support for Enhanced Allocation devices (Sean O. Stalley)
    - Add Enhanced Allocation register entries (Sean O. Stalley)
    - Handle IORESOURCE_PCI_FIXED when sizing resources (David Daney)
    - Handle IORESOURCE_PCI_FIXED when assigning resources (David Daney)
    - Handle Enhanced Allocation capability for SR-IOV devices (David Daney)
    - Clear IORESOURCE_UNSET when reverting to firmware-assigned address (Bjorn Helgaas)
    - Make Enhanced Allocation bitmasks more obvious (Bjorn Helgaas)
    - Expand Enhanced Allocation BAR output (Bjorn Helgaas)
    - Add of_pci_check_probe_only to parse "linux,pci-probe-only" (Marc Zyngier)
    - Fix lookup of linux,pci-probe-only property (Marc Zyngier)
    - Add sparc mem64 resource parsing for root bus (Yinghai Lu)

    PCI device hotplug:
    - pciehp: Queue power work requests in dedicated function (Guenter Roeck)

    Driver binding:
    - Add builtin_pci_driver() to avoid registration boilerplate (Paul Gortmaker)

    Virtualization:
    - Set SR-IOV NumVFs to zero after enumeration (Alexander Duyck)
    - Remove redundant validation of SR-IOV offset/stride registers (Alexander Duyck)
    - Remove VFs in reverse order if virtfn_add() fails (Alexander Duyck)
    - Reorder pcibios_sriov_disable() (Alexander Duyck)
    - Wait 1 second between disabling VFs and clearing NumVFs (Alexander Duyck)
    - Fix sriov_enable() error path for pcibios_enable_sriov() failures (Alexander Duyck)
    - Enable SR-IOV ARI Capable Hierarchy before reading TotalVFs (Ben Shelton)
    - Don't try to restore VF BARs (Wei Yang)

    MSI:
    - Don't alloc pcibios-irq when MSI is enabled (Joerg Roedel)
    - Add msi_controller setup_irqs() method for special multivector setup (Lucas Stach)
    - Export all remapped MSIs to sysfs attributes (Romain Bezut)
    - Disable MSI on SiS 761 (Ondrej Zary)

    AER:
    - Clear error status registers during enumeration and restore (Taku Izumi)

    Generic host bridge driver:
    - Fix lookup of linux,pci-probe-only property (Marc Zyngier)
    - Allow multiple hosts with different map_bus() methods (David Daney)
    - Pass starting bus number to pci_scan_root_bus() (David Daney)
    - Fix address window calculation for non-zero starting bus (David Daney)

    Altera host bridge driver:
    - Add msi.h to ARM Kbuild (Ley Foon Tan)
    - Add Altera PCIe host controller driver (Ley Foon Tan)
    - Add Altera PCIe MSI driver (Ley Foon Tan)

    APM X-Gene host bridge driver:
    - Remove msi_controller assignment (Duc Dang)

    Broadcom iProc host bridge driver:
    - Fix header comment "Corporation" misspelling (Florian Fainelli)
    - Fix code comment to match code (Ray Jui)
    - Remove unused struct iproc_pcie.irqs[] (Ray Jui)
    - Call pci_fixup_irqs() for ARM64 as well as ARM (Ray Jui)
    - Fix PCIe reset logic (Ray Jui)
    - Improve link detection logic (Ray Jui)
    - Update PCIe device tree bindings (Ray Jui)
    - Add outbound mapping support (Ray Jui)

    Freescale i.MX6 host bridge driver:
    - Return real error code from imx6_add_pcie_port() (Fabio Estevam)
    - Add PCIE_PHY_RX_ASIC_OUT_VALID definition (Fabio Estevam)

    Freescale Layerscape host bridge driver:
    - Remove ls_pcie_establish_link() (Minghuan Lian)
    - Ignore PCIe controllers in Endpoint mode (Minghuan Lian)
    - Factor out SCFG related function (Minghuan Lian)
    - Update ls_add_pcie_port() (Minghuan Lian)
    - Remove unused fields from struct ls_pcie (Minghuan Lian)
    - Add support for LS1043a and LS2080a (Minghuan Lian)
    - Add ls_pcie_msi_host_init() (Minghuan Lian)

    HiSilicon host bridge driver:
    - Add HiSilicon SoC Hip05 PCIe driver (Zhou Wang)

    Marvell MVEBU host bridge driver:
    - Return zero for reserved or unimplemented config space (Russell King)
    - Use exact config access size; don't read/modify/write (Russell King)
    - Use of_get_available_child_count() (Russell King)
    - Use for_each_available_child_of_node() to walk child nodes (Russell King)
    - Report full node name when reporting a DT error (Russell King)
    - Use port->name rather than "PCIe%d.%d" (Russell King)
    - Move port parsing and resource claiming to separate function (Russell King)
    - Fix memory leaks and refcount leaks (Russell King)
    - Split port parsing and resource claiming from port setup (Russell King)
    - Use gpio_set_value_cansleep() (Russell King)
    - Use devm_kcalloc() to allocate an array (Russell King)
    - Use gpio_desc to carry around gpio (Russell King)
    - Improve clock/reset handling (Russell King)
    - Add PCI Express root complex capability block (Russell King)
    - Remove code restricting accesses to slot 0 (Russell King)

    NVIDIA Tegra host bridge driver:
    - Wrap static pgprot_t initializer with __pgprot() (Ard Biesheuvel)

    Renesas R-Car host bridge driver:
    - Build pci-rcar-gen2.c only on ARM (Geert Uytterhoeven)
    - Build pcie-rcar.c only on ARM (Geert Uytterhoeven)
    - Make PCI aware of the I/O resources (Phil Edworthy)
    - Remove dependency on ARM-specific struct hw_pci (Phil Edworthy)
    - Set root bus nr to that provided in DT (Phil Edworthy)
    - Fix I/O offset for multiple host bridges (Phil Edworthy)

    ST Microelectronics SPEAr13xx host bridge driver:
    - Fix dw_pcie_cfg_read/write() usage (Gabriele Paoloni)

    Synopsys DesignWare host bridge driver:
    - Make "clocks" and "clock-names" optional DT properties (Bhupesh Sharma)
    - Use exact access size in dw_pcie_cfg_read() (Gabriele Paoloni)
    - Simplify dw_pcie_cfg_read/write() interfaces (Gabriele Paoloni)
    - Require config accesses to be naturally aligned (Gabriele Paoloni)
    - Make "num-lanes" an optional DT property (Gabriele Paoloni)
    - Move calculation of bus addresses to DRA7xx (Gabriele Paoloni)
    - Replace ARM pci_sys_data->align_resource with global function pointer (Gabriele Paoloni)
    - Factor out MSI msg setup (Lucas Stach)
    - Implement multivector MSI IRQ setup (Lucas Stach)
    - Make get_msi_addr() return phys_addr_t, not u32 (Lucas Stach)
    - Set up high part of MSI target address (Lucas Stach)
    - Fix PORT_LOGIC_LINK_WIDTH_MASK (Zhou Wang)
    - Revert "PCI: designware: Program ATU with untranslated address" (Zhou Wang)
    - Use of_pci_get_host_bridge_resources() to parse DT (Zhou Wang)
    - Make driver arch-agnostic (Zhou Wang)

    Miscellaneous:
    - Make x86 pci_subsys_init() static (Alexander Kuleshov)
    - Turn off Request Attributes to avoid Chelsio T5 Completion erratum (Hariprasad Shenai)"

    * tag 'pci-v4.4-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (94 commits)
    PCI: altera: Add Altera PCIe MSI driver
    PCI: hisi: Add HiSilicon SoC Hip05 PCIe driver
    PCI: layerscape: Add ls_pcie_msi_host_init()
    PCI: layerscape: Add support for LS1043a and LS2080a
    PCI: layerscape: Remove unused fields from struct ls_pcie
    PCI: layerscape: Update ls_add_pcie_port()
    PCI: layerscape: Factor out SCFG related function
    PCI: layerscape: Ignore PCIe controllers in Endpoint mode
    PCI: layerscape: Remove ls_pcie_establish_link()
    PCI: designware: Make "clocks" and "clock-names" optional DT properties
    PCI: designware: Make driver arch-agnostic
    ARM/PCI: Replace pci_sys_data->align_resource with global function pointer
    PCI: designware: Use of_pci_get_host_bridge_resources() to parse DT
    Revert "PCI: designware: Program ATU with untranslated address"
    PCI: designware: Move calculation of bus addresses to DRA7xx
    PCI: designware: Make "num-lanes" an optional DT property
    PCI: designware: Require config accesses to be naturally aligned
    PCI: designware: Simplify dw_pcie_cfg_read/write() interfaces
    PCI: designware: Use exact access size in dw_pcie_cfg_read()
    PCI: spear: Fix dw_pcie_cfg_read/write() usage
    ...

    Linus Torvalds
     

30 Oct, 2015

1 commit

  • Add support for devices using Enhanced Allocation entries instead of BARs.
    This allows the kernel to parse the EA Extended Capability structure in PCI
    config space and claim the BAR-equivalent resources.

    See https://pcisig.com/sites/default/files/specification_documents/ECN_Enhanced_Allocation_23_Oct_2014_Final.pdf

    [bhelgaas: add spec URL, s/pci_ea_set_flags/pci_ea_flags/, consolidate
    declarations, print unknown property in hex to match spec]
    Signed-off-by: Sean O. Stalley
    [david.daney@cavium.com: Add more support/checking for Entry Properties,
    allow EA behind bridges, rewrite some error messages.]
    Signed-off-by: David Daney
    Signed-off-by: Bjorn Helgaas

    Sean O. Stalley
     

13 Oct, 2015

1 commit

  • Commit bac2a909a096 (PCI / PM: Avoid resuming PCI devices during
    system suspend) introduced a mechanism by which some PCI devices that
    were runtime-suspended at the system suspend time might be left in
    that state for the duration of the system suspend-resume cycle.
    However, it overlooked devices that were marked as capable of waking
    up the system just because PME support was detected in their PCI
    config space.

    Namely, in that case, device_can_wakeup(dev) returns 'true' for the
    device and if the device is not configured for system wakeup,
    device_may_wakeup(dev) returns 'false' and it will be resumed during
    system suspend even though configuring it for system wakeup may not
    really make sense at all.

    To avoid this problem, simply disable PME for PCI devices that have
    not been configured for system wakeup and are runtime-suspended at
    the system suspend time for the duration of the suspend-resume cycle.

    If the device is in D3cold, its config space is not available and it
    shouldn't be written to, but that's only possible if the device
    has platform PM support and the platform code is responsible for
    checking whether or not the device's configuration is suitable for
    system suspend in that case.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     

15 Jul, 2015

1 commit


13 Jun, 2015

1 commit

  • …i', 'pci/resource' and 'pci/virtualization' into next

    * pci/aspm:
    PCI/ASPM: Simplify Clock Power Management setting
    PCI: Use dev->has_secondary_link to find downstream PCIe links
    PCI/ASPM: Use dev->has_secondary_link to find downstream links
    PCI: Add dev->has_secondary_link to track downstream PCIe links
    PCI/ASPM: Remove redundant PCIe port type checking
    PCI/ASPM: Drop __pci_disable_link_state() useless "force" parameter

    * pci/enumeration:
    PCI: Remove unused pci_scan_bus_parented()
    xen/pcifront: Don't use deprecated function pci_scan_bus_parented()
    PCI: designware: Use pci_scan_root_bus() for simplicity
    PCI: tegra: Remove tegra_pcie_scan_bus()
    PCI: mvebu: Remove mvebu_pcie_scan_bus()

    * pci/hotplug:
    PCI: pciehp: Wait for hotplug command completion where necessary
    PCI: Propagate the "ignore hotplug" setting to parent
    ACPI / hotplug / PCI: Check ignore_hotplug for all downstream devices
    PCI: pciehp: Drop pointless label from pciehp_probe()
    PCI: pciehp: Drop pointless ACPI-based "slot detection" check

    * pci/misc:
    PCI: Remove unused pci_dma_burst_advice()
    PCI: Remove unused pcibios_select_root() (again)
    PCI: Remove unnecessary #includes of <asm/pci.h>
    PCI: Include <linux/pci.h>, not <asm/pci.h>

    * pci/msi:
    PCI/MSI: Remove unused pci_msi_off()
    PCI/MSI: Drop pci_msi_off() calls from quirks
    ntb: Drop pci_msi_off() call during probe
    virtio_pci: drop pci_msi_off() call during probe
    PCI/MSI: Disable MSI at enumeration even if kernel doesn't support MSI
    PCI/MSI: Export pci_msi_set_enable(), pci_msix_clear_and_set_ctrl()
    PCI/MSI: Rename msi_set_enable(), msix_clear_and_set_ctrl()

    * pci/resource:
    PCI: Add pci_bus_addr_t

    * pci/virtualization:
    ACPI / PCI: Account for ARI in _PRT lookups
    PCI: Move pci_ari_enabled() to global header
    PCI: Add function 1 DMA alias quirk for Marvell 9120
    PCI: Add ACS quirks for Intel 9-series PCH root ports

    Bjorn Helgaas
     

30 May, 2015

1 commit

  • pci_ari_enabled() is useful outside of drivers/pci, particularly for
    deriving INTx routing via ACPI _PRT, so move it to the global header.
    Also convert to bool return.

    Signed-off-by: Alex Williamson
    Signed-off-by: Bjorn Helgaas
    Reviewed-by: Don Dutile
    Acked-by: Rafael J. Wysocki

    Alex Williamson
     

07 May, 2015

1 commit


17 Apr, 2015

1 commit

  • Pull powerpc updates from Michael Ellerman:

    - Numerous minor fixes, cleanups etc.

    - More EEH work from Gavin to remove its dependency on device_nodes.

    - Memory hotplug implemented entirely in the kernel from Nathan
    Fontenot.

    - Removal of redundant CONFIG_PPC_OF by Kevin Hao.

    - Rewrite of VPHN parsing logic & tests from Greg Kurz.

    - A fix from Nish Aravamudan to reduce memory usage by clamping
    nodes_possible_map.

    - Support for pstore on powernv from Hari Bathini.

    - Removal of old powerpc specific byte swap routines by David Gibson.

    - Fix from Vasant Hegde to prevent the flash driver telling you it was
    flashing your firmware when it wasn't.

    - Patch from Ben Herrenschmidt to add an OPAL heartbeat driver.

    - Fix for an oops causing get/put_cpu_var() imbalance in perf by Jan
    Stancek.

    - Some fixes for migration from Tyrel Datwyler.

    - A new syscall to switch the cpu endian by Michael Ellerman.

    - Large series from Wei Yang to implement SRIOV, reviewed and acked by
    Bjorn.

    - A fix for the OPAL sensor driver from Cédric Le Goater.

    - Fixes to get STRICT_MM_TYPECHECKS building again by Michael Ellerman.

    - Large series from Daniel Axtens to make our PCI hooks per PHB rather
    than per machine.

    - Small patch from Sam Bobroff to explicitly abort non-suspended
    transactions on syscalls, plus a test to exercise it.

    - Numerous reworks and fixes for the 24x7 PMU from Sukadev Bhattiprolu.

    - Small patch to enable the hard lockup detector from Anton Blanchard.

    - Fix from Dave Olson for missing L2 cache information on some CPUs.

    - Some fixes from Michael Ellerman to get Cell machines booting again.

    - Freescale updates from Scott: Highlights include BMan device tree
    nodes, an MSI erratum workaround, a couple minor performance
    improvements, config updates, and misc fixes/cleanup.

    * tag 'powerpc-4.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mpe/linux: (196 commits)
    powerpc/powermac: Fix build error seen with powermac smp builds
    powerpc/pseries: Fix compile of memory hotplug without CONFIG_MEMORY_HOTREMOVE
    powerpc: Remove PPC32 code from pseries specific find_and_init_phbs()
    powerpc/cell: Fix iommu breakage caused by controller_ops change
    powerpc/eeh: Fix crash in eeh_add_device_early() on Cell
    powerpc/perf: Cap 64bit userspace backtraces to PERF_MAX_STACK_DEPTH
    powerpc/perf/hv-24x7: Fail 24x7 initcall if create_events_from_catalog() fails
    powerpc/pseries: Correct memory hotplug locking
    powerpc: Fix missing L2 cache size in /sys/devices/system/cpu
    powerpc: Add ppc64 hard lockup detector support
    oprofile: Disable oprofile NMI timer on ppc64
    powerpc/perf/hv-24x7: Add missing put_cpu_var()
    powerpc/perf/hv-24x7: Break up single_24x7_request
    powerpc/perf/hv-24x7: Define update_event_count()
    powerpc/perf/hv-24x7: Whitespace cleanup
    powerpc/perf/hv-24x7: Define add_event_to_24x7_request()
    powerpc/perf/hv-24x7: Rename hv_24x7_event_update
    powerpc/perf/hv-24x7: Move debug prints to separate function
    powerpc/perf/hv-24x7: Drop event_24x7_request()
    powerpc/perf/hv-24x7: Use pr_devel() to log message
    ...

    Conflicts:
    tools/testing/selftests/powerpc/Makefile
    tools/testing/selftests/powerpc/tm/Makefile

    Linus Torvalds
     

09 Apr, 2015

1 commit


31 Mar, 2015

2 commits

  • An SR-IOV device can change its First VF Offset and VF Stride based on the
    values of ARI Capable Hierarchy and NumVFs. The number of buses required
    for all VFs is determined by NumVFs, First VF Offset, and VF Stride (see
    SR-IOV spec r1.1, sec 2.1.2).

    Previously pci_iov_bus_range() computed how many buses would be required by
    TotalVFs, but this was based on a single NumVFs value and may not have been
    the maximum for all NumVFs configurations.

    Iterate over all valid NumVFs and calculate the maximum number of bus
    numbers that could ever be required for VFs of this device.

    [bhelgaas: changelog, compute busnr of NumVFs, not TotalVFs, remove
    kerenl-doc comment marker]
    Signed-off-by: Wei Yang
    Acked-by: Bjorn Helgaas
    Signed-off-by: Benjamin Herrenschmidt

    Wei Yang
     
  • Currently we don't store the individual VF BAR size. We calculate it when
    needed by dividing the PF's IOV resource size (which contains space for
    *all* the VFs) by total_VFs or by reading the BAR in the SR-IOV capability
    again.

    Keep the individual VF BAR size in struct pci_sriov.barsz[], add
    pci_iov_resource_size() to retrieve it, and use that instead of doing the
    division or reading the SR-IOV capability BAR.

    [bhelgaas: rename to "barsz[]", simplify barsz[] index computation, remove
    SR-IOV capability BAR sizing]
    Signed-off-by: Wei Yang
    Acked-by: Bjorn Helgaas
    Signed-off-by: Benjamin Herrenschmidt

    Wei Yang
     

10 Feb, 2015

1 commit


24 Jan, 2015

1 commit

  • Commit f25c0ae2b4c4 (ACPI / PM: Avoid resuming devices in ACPI PM
    domain during system suspend) modified the ACPI PM domain's system
    suspend callbacks to allow devices attached to it to be left in the
    runtime-suspended state during system suspend so as to optimize
    the suspend process.

    This was based on the general mechanism introduced by commit
    aae4518b3124 (PM / sleep: Mechanism to avoid resuming runtime-suspended
    devices unnecessarily).

    Extend that approach to PCI devices by modifying the PCI bus type's
    ->prepare callback to return 1 for devices that are runtime-suspended
    when it is being executed and that are in a suitable power state and
    need not be resumed going forward.

    Signed-off-by: Rafael J. Wysocki
    Acked-by: Bjorn Helgaas

    Rafael J. Wysocki
     

17 Jan, 2015

1 commit

  • Add pci_bus_clip_resource(). If a PCI-PCI bridge window overlaps an
    upstream bridge window but is not completely contained by it, this clips
    the downstream window so it fits inside the upstream one.

    No functional change (this adds the function but no callers).

    [bhelgaas: changelog, split into separate patch]
    Link: https://bugzilla.kernel.org/show_bug.cgi?id=85491
    Reported-by: Marek Kordik
    Fixes: 5b28541552ef ("PCI: Restrict 64-bit prefetchable bridge windows to 64-bit resources")
    Signed-off-by: Yinghai Lu
    Signed-off-by: Bjorn Helgaas
    CC: stable@vger.kernel.org # v3.16+

    Yinghai Lu
     

11 Dec, 2014

1 commit

  • Pull PCI changes from Bjorn Helgaas:
    "Here are the PCI changes intended for v3.19. I don't think there's
    anything very exciting here, but there was a lot of MSI-related stuff
    coming via Thomas.

    Details:

    NUMA
    - Allow numa_node override via sysfs (Prarit Bhargava)

    Resource management
    - Restore detection of read-only BARs (Myron Stowe)
    - Shrink decoding-disabled window while sizing BARs (Myron Stowe)
    - Add informational printk for invalid BARs (Myron Stowe)
    - Remove fixed parameter in pci_iov_resource_bar() (Myron Stowe)

    MSI
    - Add pci_msi_ignore_mask to prevent writes to MSI/MSI-X Mask Bits (Yijing Wang)
    - Revert "PCI: Add x86_msi.msi_mask_irq() and msix_mask_irq()" (Yijing Wang)
    - s390/MSI: Use __msi_mask_irq() instead of default_msi_mask_irq() (Yijing Wang)

    Virtualization
    - xen: Process failure for pcifront_(re)scan_root() (Chen Gang)
    - Make FLR and AF FLR reset warning messages different (Gavin Shan)

    Generic host bridge driver
    - Allocate config space windows after limiting bus number range (Lorenzo Pieralisi)
    - Convert to DT resource parsing API (Lorenzo Pieralisi)

    Freescale Layerscape
    - Add Freescale Layerscape PCIe driver (Minghuan Lian)

    NVIDIA Tegra
    - Do not build on 64-bit ARM (Thierry Reding)
    - Add Kconfig help text (Thierry Reding)

    Renesas R-Car
    - Make rcar_pci static (Jingoo Han)

    Samsung Exynos
    - Add exynos prefix to add_pcie_port(), pcie_init() (Jingoo Han)

    ST Microelectronics SPEAr13xx
    - Add spear prefix to add_pcie_port(), pcie_init() (Jingoo Han)
    - Make spear13xx_add_pcie_port() __init (Jingoo Han)
    - Remove unnecessary OOM message (Jingoo Han)

    TI DRA7xx
    - Add dra7xx prefix to add_pcie_port() (Jingoo Han)
    - Make dra7xx_add_pcie_port() __init (Jingoo Han)

    TI Keystone
    - Make ks_dw_pcie_msi_domain_ops static (Jingoo Han)
    - Remove unnecessary OOM message (Jingoo Han)

    Miscellaneous
    - Delete unnecessary NULL pointer checks (Markus Elfring)
    - Remove unused to_hotplug_slot() (Gavin Shan)
    - Whitespace cleanup (Jingoo Han)
    - Simplify if-return sequences (Quentin Lambert)"

    * tag 'pci-v3.19-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (28 commits)
    PCI: Remove fixed parameter in pci_iov_resource_bar()
    PCI: Add informational printk for invalid BARs
    PCI: tegra: Add Kconfig help text
    PCI: tegra: Do not build on 64-bit ARM
    PCI: spear: Remove unnecessary OOM message
    PCI: mvebu: Add a blank line after declarations
    PCI: designware: Add a blank line after declarations
    PCI: exynos: Remove unnecessary return statement
    PCI: imx6: Use tabs for indentation
    PCI: keystone: Remove unnecessary OOM message
    PCI: Remove unused and broken to_hotplug_slot()
    PCI: Make FLR and AF FLR reset warning messages different
    PCI: dra7xx: Add __init annotation to dra7xx_add_pcie_port()
    PCI: spear: Add __init annotation to spear13xx_add_pcie_port()
    PCI: spear: Rename add_pcie_port(), pcie_init() to spear13xx_add_pcie_port(), etc.
    PCI: dra7xx: Rename add_pcie_port() to dra7xx_add_pcie_port()
    PCI: layerscape: Add Freescale Layerscape PCIe driver
    PCI: Simplify if-return sequences
    PCI: Delete unnecessary NULL pointer checks
    PCI: Shrink decoding-disabled window while sizing BARs
    ...

    Linus Torvalds
     

20 Nov, 2014

1 commit


14 Nov, 2014

1 commit

  • Previously we applied _HPX type 2 record Link Control register settings
    only to bridges with a subordinate bus. But it's better to apply them to
    all devices with a link because if the subordinate bus has not been
    allocated yet, we won't apply settings to the device.

    Use pcie_cap_has_lnkctl() to determine whether the device has a Link
    Control register instead of looking at dev->subordinate.

    [bhelgaas: changelog]
    Fixes: 6cd33649fa83 ("PCI: Add pci_configure_device() during enumeration")
    Signed-off-by: Yinghai Lu
    Signed-off-by: Bjorn Helgaas

    Yinghai Lu
     

29 May, 2014

1 commit

  • * pci/hotplug:
    PCI: cpqphp: Fix possible null pointer dereference
    NVMe: Implement PCIe reset notification callback
    PCI: Notify driver before and after device reset

    * pci/pci_is_bridge:
    pcmcia: Use pci_is_bridge() to simplify code
    PCI: pciehp: Use pci_is_bridge() to simplify code
    PCI: acpiphp: Use pci_is_bridge() to simplify code
    PCI: cpcihp: Use pci_is_bridge() to simplify code
    PCI: shpchp: Use pci_is_bridge() to simplify code
    PCI: rpaphp: Use pci_is_bridge() to simplify code
    sparc/PCI: Use pci_is_bridge() to simplify code
    powerpc/PCI: Use pci_is_bridge() to simplify code
    ia64/PCI: Use pci_is_bridge() to simplify code
    x86/PCI: Use pci_is_bridge() to simplify code
    PCI: Use pci_is_bridge() to simplify code
    PCI: Add new pci_is_bridge() interface
    PCI: Rename pci_is_bridge() to pci_has_subordinate()

    * pci/virtualization:
    PCI: Introduce new device binding path using pci_dev.driver_override

    Conflicts:
    drivers/pci/pci-sysfs.c

    Bjorn Helgaas
     

28 May, 2014

1 commit


30 Apr, 2014

1 commit

  • Some PCI functions used to be marked __devinit. When CONFIG_HOTPLUG was
    not set, these functions were discarded after boot. A few callers of these
    __devinit functions were marked __ref to indicate that they could safely
    call the __devinit functions even though the callers were not __devinit.

    But CONFIG_HOTPLUG and __devinit are now gone, and the need for the __ref
    annotations is also gone, so remove them. Relevant historical commits:

    54b956b90360 Remove __dev* markings from init.h
    a8e4b9c101ae PCI: add generic pci_hp_add_bridge()
    0ab2b57f8db8 PCI: fix section mismatch warning in pci_scan_child_bus
    451124a7cc6c PCI: fix 4x section mismatch warnings

    Signed-off-by: Bjorn Helgaas

    Bjorn Helgaas
     

20 Feb, 2014

1 commit

  • This reverts commit 74bb1bcc7dbb ("PCI: handle SR-IOV Virtual Function
    Migration"), removing this exported interface:

    pci_sriov_migration()

    Since pci_sriov_migration() is unused, it is impossible to schedule
    sriov_migration_task() or use any of the other migration infrastructure.

    This is based on Stephen Hemminger's patch (see link below), but goes a bit
    further.

    Link: http://lkml.kernel.org/r/20131227132710.7190647c@nehalam.linuxnetplumber.net
    Signed-off-by: Bjorn Helgaas
    CC: Stephen Hemminger

    Bjorn Helgaas
     

14 Jan, 2014

1 commit

  • Using 'make namespacecheck' identify code which should be declared static.
    Checked for users in other driver/archs as well. Compile tested only.

    This stops exporting the following interfaces to modules:

    pci_target_state()
    pci_load_saved_state()

    [bhelgaas: retained pci_find_next_ext_capability() and pci_cfg_space_size()]
    Signed-off-by: Stephen Hemminger
    Signed-off-by: Bjorn Helgaas

    Stephen Hemminger
     

08 Oct, 2013

2 commits


06 Sep, 2013

1 commit

  • Pull networking changes from David Miller:
    "Noteworthy changes this time around:

    1) Multicast rejoin support for team driver, from Jiri Pirko.

    2) Centralize and simplify TCP RTT measurement handling in order to
    reduce the impact of bad RTO seeding from SYN/ACKs. Also, when
    both timestamps and local RTT measurements are available prefer
    the later because there are broken middleware devices which
    scramble the timestamp.

    From Yuchung Cheng.

    3) Add TCP_NOTSENT_LOWAT socket option to limit the amount of kernel
    memory consumed to queue up unsend user data. From Eric Dumazet.

    4) Add a "physical port ID" abstraction for network devices, from
    Jiri Pirko.

    5) Add a "suppress" operation to influence fib_rules lookups, from
    Stefan Tomanek.

    6) Add a networking development FAQ, from Paul Gortmaker.

    7) Extend the information provided by tcp_probe and add ipv6 support,
    from Daniel Borkmann.

    8) Use RCU locking more extensively in openvswitch data paths, from
    Pravin B Shelar.

    9) Add SCTP support to openvswitch, from Joe Stringer.

    10) Add EF10 chip support to SFC driver, from Ben Hutchings.

    11) Add new SYNPROXY netfilter target, from Patrick McHardy.

    12) Compute a rate approximation for sending in TCP sockets, and use
    this to more intelligently coalesce TSO frames. Furthermore, add
    a new packet scheduler which takes advantage of this estimate when
    available. From Eric Dumazet.

    13) Allow AF_PACKET fanouts with random selection, from Daniel
    Borkmann.

    14) Add ipv6 support to vxlan driver, from Cong Wang"

    Resolved conflicts as per discussion.

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1218 commits)
    openvswitch: Fix alignment of struct sw_flow_key.
    netfilter: Fix build errors with xt_socket.c
    tcp: Add missing braces to do_tcp_setsockopt
    caif: Add missing braces to multiline if in cfctrl_linkup_request
    bnx2x: Add missing braces in bnx2x:bnx2x_link_initialize
    vxlan: Fix kernel panic on device delete.
    net: mvneta: implement ->ndo_do_ioctl() to support PHY ioctls
    net: mvneta: properly disable HW PHY polling and ensure adjust_link() works
    icplus: Use netif_running to determine device state
    ethernet/arc/arc_emac: Fix huge delays in large file copies
    tuntap: orphan frags before trying to set tx timestamp
    tuntap: purge socket error queue on detach
    qlcnic: use standard NAPI weights
    ipv6:introduce function to find route for redirect
    bnx2x: VF RSS support - VF side
    bnx2x: VF RSS support - PF side
    vxlan: Notify drivers for listening UDP port changes
    net: usbnet: update addr_assign_type if appropriate
    driver/net: enic: update enic maintainers and driver
    driver/net: enic: Exposing symbols for Cisco's low latency driver
    ...

    Linus Torvalds
     

31 Jul, 2013

1 commit

  • pcie_link_speed and pcix_bus_speed are arrays used by probe.c to correctly
    convert lnksta register values into the pci_bus_speed enum. These static arrays
    are useful outside probe for this purpose. This patch makes these defines into
    conist arrays and exposes them with an extern header in drivers/pci/pci.h

    -v2-
    * move extern declarations to drivers/pci/pci.h

    CC: Bjorn Helgaas
    Signed-off-by: Jacob Keller
    Signed-off-by: Jeff Kirsher

    Jacob Keller
     

26 Jul, 2013

1 commit


23 Jun, 2013

1 commit

  • On x86 platforms, the kernel respects PCI resource assignments from
    the BIOS and only reassigns resources for unassigned BARs at boot
    time. However, with the ACPI-based hotplug (acpiphp), it ignores the
    BIOS' PCI resource assignments completely and reassigns all resources
    by itself. This causes differences in PCI resource allocation
    between boot time and runtime hotplug to occur, which is generally
    undesirable and sometimes actively breaks things.

    Namely, if there are enough resources, reassigning all PCI resources
    during runtime hotplug should work, but it may fail if the resources
    are constrained. This may happen, for instance, when some PCI
    devices with huge MMIO BARs are involved in the runtime hotplug
    operations, because the current PCI MMIO alignment algorithm may
    waste huge chunks of MMIO address space in those cases.

    On the Alexander's Sony VAIO VPCZ23A4R the BIOS allocates limited
    MMIO resources for the dock station which contains a device
    (graphics adapter) with a 256MB MMIO BAR. An attempt to reassign
    that during runtime hotplug causes the dock station MMIO window to be
    exhausted and acpiphp fails to allocate resources for the majority
    of devices on the dock station as a result.

    To prevent that from happening, modify acpiphp to follow the boot
    time resources allocation behavior so that the BIOS' resource
    assignments are respected during runtime hotplug too.

    [rjw: Changelog]
    References: https://bugzilla.kernel.org/show_bug.cgi?id=56531
    Reported-and-tested-by: Alexander E. Patrakov
    Tested-by: Illya Klymov
    Signed-off-by: Jiang Liu
    Acked-by: Yinghai Lu
    Cc: 3.9+
    Signed-off-by: Rafael J. Wysocki

    Jiang Liu
     

18 Apr, 2013

1 commit


27 Jan, 2013

2 commits

  • * pci/yinghai-root-bus-hotplug:
    PCI: Put pci_dev in device tree as early as possible
    PCI: Skip attaching driver in device_add()
    PCI: acpiphp: Keep driver loaded even if no slots found
    PCI/ACPI: Print info if host bridge notify handler installation fails
    PCI: acpiphp: Move host bridge hotplug to pci_root.c
    PCI/ACPI: acpiphp: Rename alloc_acpiphp_hp_work() to alloc_acpi_hp_work()
    PCI: Make device create/destroy logic symmetric
    PCI: Fix reference count leak in pci_dev_present()
    PCI: Set pci_dev dev_node early so IOAPIC irq_descs are allocated locally
    PCI: Add root bus children dev's res to fail list
    PCI: acpiphp: Add is_hotplug_bridge detection

    Conflicts:
    drivers/pci/pci.h

    Bjorn Helgaas
     
  • * pci/yijing-ari:
    PCI: shpchp: Iterate over all devices in slot, not functions 0-7
    PCI: sgihp: Iterate over all devices in slot, not functions 0-7
    PCI: cpcihp: Iterate over all devices in slot, not functions 0-7
    PCI: pciehp: Iterate over all devices in slot, not functions 0-7
    PCI: Consolidate "next-function" functions
    PCI: Rename pci_enable_ari() to pci_configure_ari()
    PCI: Enable ARI if dev and upstream bridge support it; disable otherwise

    Bjorn Helgaas
     

26 Jan, 2013

2 commits

  • We want to put pci_dev structs in the device tree as soon as possible so
    for_each_pci_dev() iteration will not miss them, but driver attachment
    needs to be delayed until after pci_assign_unassigned_resources() to make
    sure all devices have resources assigned first.

    This patch moves device registering from pci_bus_add_devices() to
    pci_device_add(), which happens earlier, leaving driver attachment in
    pci_bus_add_devices().

    It also removes unattached child bus handling in pci_bus_add_devices().
    That's not needed because child bus via pci_add_new_bus() is already
    in parent bus children list.

    [bhelgaas: changelog]
    Signed-off-by: Yinghai Lu
    Signed-off-by: Bjorn Helgaas
    Acked-by: Rafael J. Wysocki

    Yinghai Lu
     
  • pci_enable_ari() now supports enabling or disabling ARI forwarding. So
    rename pci_enable_ari() to pci_configure_ari() for easy understanding.

    No functional change.

    [bhelgaas: changelog]
    Signed-off-by: Yijing Wang
    Signed-off-by: Bjorn Helgaas

    Yijing Wang
     

03 Jan, 2013

1 commit

  • Currently, the ACPI wakeup capability of PCI devices is set up
    in two different places, partially in acpi_pci_bind() where
    runtime wakeup is initialized and partially in
    platform_pci_wakeup_init(), where system wakeup is initialized.
    The cleanup is only done in acpi_pci_unbind() and it only covers
    runtime wakeup.

    Use the new .setup() and .cleanup() callbacks in struct acpi_bus_type
    to consolidate that code and do the setup and the cleanup each in one
    place.

    Signed-off-by: Rafael J. Wysocki
    Acked-by: Yinghai Lu
    Acked-by: Toshi Kani

    Rafael J. Wysocki
     

14 Dec, 2012

1 commit

  • Pull PCI update from Bjorn Helgaas:
    "Host bridge hotplug:
    - Untangle _PRT from struct pci_bus (Bjorn Helgaas)
    - Request _OSC control before scanning root bus (Taku Izumi)
    - Assign resources when adding host bridge (Yinghai Lu)
    - Remove root bus when removing host bridge (Yinghai Lu)
    - Remove _PRT during hot remove (Yinghai Lu)

    SRIOV
    - Add sysfs knobs to control numVFs (Don Dutile)

    Power management
    - Notify devices when power resource turned on (Huang Ying)

    Bug fixes
    - Work around broken _SEG on HP xw9300 (Bjorn Helgaas)
    - Keep runtime PM enabled for unbound PCI devices (Huang Ying)
    - Fix Optimus dual-GPU runtime D3 suspend issue (Dave Airlie)
    - Fix xen frontend shutdown issue (David Vrabel)
    - Work around PLX PCI 9050 BAR alignment erratum (Ian Abbott)

    Miscellaneous
    - Add GPL license for drivers/pci/ioapic (Andrew Cooks)
    - Add standard PCI-X, PCIe ASPM register #defines (Bjorn Helgaas)
    - NumaChip remote PCI support (Daniel Blueman)
    - Fix PCIe Link Capabilities Supported Link Speed definition (Jingoo
    Han)
    - Convert dev_printk() to dev_info(), etc (Joe Perches)
    - Add support for non PCI BAR ROM data (Matthew Garrett)
    - Add x86 support for host bridge translation offset (Mike Yoknis)
    - Report success only when every driver supports AER (Vijay
    Pandarathil)"

    Fix up trivial conflicts.

    * tag 'for-3.8' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (48 commits)
    PCI: Use phys_addr_t for physical ROM address
    x86/PCI: Add NumaChip remote PCI support
    ath9k: Use standard #defines for PCIe Capability ASPM fields
    iwlwifi: Use standard #defines for PCIe Capability ASPM fields
    iwlwifi: collapse wrapper for pcie_capability_read_word()
    iwlegacy: Use standard #defines for PCIe Capability ASPM fields
    iwlegacy: collapse wrapper for pcie_capability_read_word()
    cxgb3: Use standard #defines for PCIe Capability ASPM fields
    PCI: Add standard PCIe Capability Link ASPM field names
    PCI/portdrv: Use PCI Express Capability accessors
    PCI: Use standard PCIe Capability Link register field names
    x86: Use PCI setup data
    PCI: Add support for non-BAR ROMs
    PCI: Add pcibios_add_device
    EFI: Stash ROMs if they're not in the PCI BAR
    PCI: Add and use standard PCI-X Capability register names
    PCI/PM: Keep runtime PM enabled for unbound PCI devices
    xen-pcifront: Handle backend CLOSED without CLOSING
    PCI: SRIOV control and status via sysfs (documentation)
    PCI/AER: Report success only when every device has AER-aware driver
    ...

    Linus Torvalds
     

29 Nov, 2012

1 commit

  • With the demise of CONFIG_HOTPLUG as an option, the pci_uevent
    function located in hotplug.c will now always be used and doesn't need
    special treatment in the Makefile. Move pci_uevent into pci-driver.c
    and remove hotplug.c

    Signed-off-by: Bill Pemberton
    Acked-by: Bjorn Helgaas
    Signed-off-by: Greg Kroah-Hartman

    Bill Pemberton