1. Nov 15, 2017
    • Bjorn Helgaas's avatar
      Merge branch 'pci/host-iproc' into next · aaea12f7
      Bjorn Helgaas authored
      * pci/host-iproc:
        PCI: iproc: Allow allocation of multiple MSIs
      aaea12f7
    • Bjorn Helgaas's avatar
      Merge branch 'pci/host-hv' into next · 85a8cf8e
      Bjorn Helgaas authored
      * pci/host-hv:
        PCI: hv: Use effective affinity mask
      85a8cf8e
    • Bjorn Helgaas's avatar
      Merge branch 'pci/host-hisi' into next · 22111ff4
      Bjorn Helgaas authored
      * pci/host-hisi:
        PCI: hisi: Add HiSilicon STB SoC PCIe controller driver
      22111ff4
    • Bjorn Helgaas's avatar
      Merge branch 'pci/host-generic' into next · d5359696
      Bjorn Helgaas authored
      * pci/host-generic:
        dt-bindings: PCI: designware: Add binding for Designware PCIe in ECAM mode
        PCI: generic: Add support for Synopsys DesignWare RC in ECAM mode
      d5359696
    • Bjorn Helgaas's avatar
      Merge branch 'pci/host-faraday' into next · 807dcfee
      Bjorn Helgaas authored
      * pci/host-faraday:
        PCI: faraday: Fix wrong pointer passed to PTR_ERR()
      807dcfee
    • Bjorn Helgaas's avatar
      Merge branch 'pci/host-dra7xx' into next · f21bfb56
      Bjorn Helgaas authored
      * pci/host-dra7xx:
        PCI: dra7xx: Add shutdown handler to cleanly turn off clocks
      f21bfb56
    • Bjorn Helgaas's avatar
      Merge branch 'pci/host-altera' into next · afa77456
      Bjorn Helgaas authored
      * pci/host-altera:
        PCI: altera: Rename altera_pcie_link_is_up() to altera_pcie_link_up()
      afa77456
    • Bjorn Helgaas's avatar
      Merge branch 'pci/virtualization' into next · 9ceb09cc
      Bjorn Helgaas authored
      * pci/virtualization:
        PCI: Document reset method return values
        PCI: Detach driver before procfs & sysfs teardown on device remove
        PCI: Apply Cavium ThunderX ACS quirk to more Root Ports
        PCI: Set Cavium ACS capability quirk flags to assert RR/CR/SV/UF
        PCI: Restore ARI Capable Hierarchy before setting numVFs
        PCI: Create SR-IOV virtfn/physfn links before attaching driver
        PCI: Expose SR-IOV offset, stride, and VF device ID via sysfs
        PCI: Cache the VF device ID in the SR-IOV structure
        PCI: Add Kconfig PCI_IOV dependency for PCI_REALLOC_ENABLE_AUTO
        PCI: Remove unused function __pci_reset_function()
        PCI: Remove reset argument from pci_iov_{add,remove}_virtfn()
      9ceb09cc
    • Bjorn Helgaas's avatar
      Merge branch 'pci/switchtec' into next · 9af21ac5
      Bjorn Helgaas authored
      * pci/switchtec:
        switchtec: Make struct event_regs static
      9af21ac5
    • Bjorn Helgaas's avatar
      Merge branch 'pci/resource' into next · 104d1e40
      Bjorn Helgaas authored
      * pci/resource:
        PCI: Fail pci_map_rom() if the option ROM is invalid
        PCI: Move pci_map_rom() error path
        x86/PCI: Enable a 64bit BAR on AMD Family 15h (Models 00-1f, 30-3f, 60-7f)
        PCI: Add pci_resize_resource() for resizing BARs
        PCI: Add resizable BAR infrastructure
        PCI: Add PCI resource type mask #define
      104d1e40
    • Bjorn Helgaas's avatar
      Merge branch 'pci/portdrv' into next · 8dceeaf8
      Bjorn Helgaas authored
      * pci/portdrv:
        PCI/portdrv: Turn off PCIe services during shutdown
      8dceeaf8
    • Bjorn Helgaas's avatar
      Merge branch 'pci/msi' into next · 6018182d
      Bjorn Helgaas authored
      * pci/msi:
        PCI/portdrv: Compute MSI/MSI-X IRQ vectors after final allocation
        PCI/portdrv: Factor out Interrupt Message Number lookup
        PCI/portdrv: Consolidate comments
        PCI/portdrv: Add #defines for AER and DPC Interrupt Message Number masks
      6018182d
    • Bjorn Helgaas's avatar
      Merge branch 'pci/misc' into next · 65a129d7
      Bjorn Helgaas authored
      * pci/misc:
        PCI: Fix kernel-doc build warning
        PCI: Move PCI_QUIRKS to the PCI bus menu
        alpha/PCI: Make pdev_save_srm_config() static
        PCI: Remove unused declarations
        PCI: Remove redundant pci_dev, pci_bus, resource declarations
        PCI: Remove redundant pcibios_set_master() declarations
        PCI/PME: Handle invalid data when reading Root Status
        x86/pci/intel_mid_pci: Constify intel_mid_pci_ops and make it __initconst
        PCI: Constify pci_dev_type structure
      65a129d7
    • Bjorn Helgaas's avatar
      Merge branch 'pci/hotplug' into next · 8d666e53
      Bjorn Helgaas authored
      * pci/hotplug:
        PCI: pciehp: Do not clear Presence Detect Changed during initialization
        PCI: pciehp: Fix race condition handling surprise link down
        PCI: Distribute available resources to hotplug-capable bridges
        PCI: Distribute available buses to hotplug-capable bridges
        PCI: Do not allocate more buses than available in parent
        PCI: Open-code the two pass loop when scanning bridges
        PCI: Move pci_hp_add_bridge() to drivers/pci/probe.c
        PCI: Add for_each_pci_bridge() helper
        PCI: shpchp: Convert timers to use timer_setup()
        PCI: cpqphp: Convert timers to use timer_setup()
        PCI: pciehp: Convert timers to use timer_setup()
        PCI: ibmphp: Use common error handling code in unconfigure_boot_device()
      8d666e53
    • Bjorn Helgaas's avatar
      Merge branch 'pci/endpoint' into next · 1a03bac3
      Bjorn Helgaas authored
      * pci/endpoint:
        misc: pci_endpoint_test: Fix BUG_ON error during pci_disable_msi()
        misc: pci_endpoint_test: Fix pci_endpoint_test not releasing resources on remove
        misc: pci_endpoint_test: Fix failure path return values in probe
        misc: pci_endpoint_test: Avoid triggering a BUG()
        misc: pci_endpoint_test: Prevent some integer overflows
      1a03bac3
    • Bjorn Helgaas's avatar
      Merge branch 'pci/aspm' into next · 9c42da50
      Bjorn Helgaas authored
      * pci/aspm:
        PCI/ASPM: Add L1 Substates definitions
        PCI/ASPM: Reformat ASPM register definitions
        PCI/ASPM: Use correct capability pointer to program LTR_L1.2_THRESHOLD
        PCI/ASPM: Account for downstream device's Port Common_Mode_Restore_Time
        PCI/ASPM: Deal with missing root ports in link state handling
      9c42da50
    • Bjorn Helgaas's avatar
      Merge branch 'pci/aer' into next · f5b4f7ce
      Bjorn Helgaas authored
      * pci/aer:
        PCI/AER: Report non-fatal errors only to the affected endpoint
      f5b4f7ce
    • Bjorn Helgaas's avatar
      Merge branch 'pci/acpi' into next · a9a6bb46
      Bjorn Helgaas authored
      * pci/acpi:
        ACPI / PCI: Bail early in acpi_pci_add_bus() if there is no ACPI handle
      a9a6bb46
  2. Nov 14, 2017
  3. Nov 10, 2017
  4. Nov 09, 2017
  5. Nov 08, 2017
  6. Nov 07, 2017
    • Mika Westerberg's avatar
      PCI: pciehp: Do not clear Presence Detect Changed during initialization · db63d400
      Mika Westerberg authored
      
      
      It is possible that the hotplug event has already happened before the
      driver is attached to a PCIe hotplug downstream port. If we just clear the
      status we never get the hotplug interrupt and thus the event will be
      missed.
      
      To make sure that does not happen, we leave Presence Detect Changed bit
      untouched during initialization. Then once the event is unmasked we get an
      interrupt and handle the hotplug event properly.
      
      Signed-off-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      db63d400
    • Mika Westerberg's avatar
      PCI: pciehp: Fix race condition handling surprise link down · 49902239
      Mika Westerberg authored
      A surprise link down may retrain very quickly causing the same slot
      generate a link up event before handling the link down event completes.
      
      Since the link is active, the power off work queued from the first link
      down will cause a second down event when power is disabled. However, the
      link up event sets the slot state to POWERON_STATE before the event to
      handle this is enqueued, making the second down event believe it needs to
      do something.
      
      This creates constant link up and down event cycle.
      
      To prevent this it is better to handle each event at the time in order it
      occurred, so change the driver to use ordered workqueue instead.
      
      A normal device hotplug triggers two events (presense detect and link up)
      that are already handled properly in the driver but we currently log an
      error if we find an existing device in the slot. Since this is not an error
      change the log level to be debug instead to avoid scaring users.
      
      This is based on the original work by Ashok Raj.
      
      Link: https://patchwork.kernel.org/patch/9469023
      
      
      Suggested-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Signed-off-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      49902239
    • Mika Westerberg's avatar
      PCI: Distribute available resources to hotplug-capable bridges · 1a576772
      Mika Westerberg authored
      
      
      The same problem that we have with bus space applies to other resources
      as well. Linux only allocates the minimal amount of resources so that
      the devices currently present barely fit there. This prevents extending
      the chain later on because the resource windows allocated for hotplug
      downstream ports are too small.
      
      Follow what we already did for bus number and assign all available extra
      resources to hotplug-capable bridges. This makes it possible to extend the
      hierarchy later.
      
      Signed-off-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      1a576772
    • Mika Westerberg's avatar
      PCI: Distribute available buses to hotplug-capable bridges · 1c02ea81
      Mika Westerberg authored
      
      
      System BIOS sometimes allocates extra bus space for hotplug-capable PCIe
      root/downstream ports. This space is needed if the device plugged to the
      port will have more hotplug-capable downstream ports. A good example of
      this is Thunderbolt. Each Thunderbolt device contains a PCIe switch and
      one or more hotplug-capable PCIe downstream ports where the daisy chain
      can be extended.
      
      Currently Linux only allocates minimal bus space to make sure all the
      enumerated devices barely fit there. The BIOS reserved extra space is
      not taken into consideration at all. Because of this we run out of bus
      space pretty quickly when more PCIe devices are attached to hotplug
      downstream ports in order to extend the chain.
      
      Modify the PCI core so we distribute the available BIOS allocated bus space
      equally between hotplug-capable bridges to make sure there is enough bus
      space for extending the hierarchy later on.
      
      Update kernel docs of the affected functions.
      
      Signed-off-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      1c02ea81
    • Mika Westerberg's avatar
      PCI: Do not allocate more buses than available in parent · a20c7f36
      Mika Westerberg authored
      
      
      One can ask more buses to be reserved for hotplug bridges by passing
      pci=hpbussize=N in the kernel command line.  If the parent bus does not
      have enough bus space available we incorrectly create child bus with the
      requested number of subordinate buses.
      
      In the example below hpbussize is set to one more than we have available
      buses in the root port:
      
        pci 0000:07:00.0: [8086:1578] type 01 class 0x060400
        pci 0000:07:00.0: scanning [bus 00-00] behind bridge, pass 0
        pci 0000:07:00.0: bridge configuration invalid ([bus 00-00]), reconfiguring
        pci 0000:07:00.0: scanning [bus 00-00] behind bridge, pass 1
        pci_bus 0000:08: busn_res: can not insert [bus 08-ff] under [bus 07-3f] (conflicts with (null) [bus 07-3f])
        pci_bus 0000:08: scanning bus
        ...
        pci_bus 0000:0a: bus scan returning with max=40
        pci_bus 0000:0a: busn_res: [bus 0a-ff] end is updated to 40
        pci_bus 0000:0a: [bus 0a-40] partially hidden behind bridge 0000:07 [bus 07-3f]
        pci_bus 0000:08: bus scan returning with max=40
        pci_bus 0000:08: busn_res: [bus 08-ff] end is updated to 40
      
      Instead of allowing this, limit the subordinate number to be less than or
      equal the maximum subordinate number allocated for the parent bus (if it
      has any).
      
      Signed-off-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
      [bhelgaas: remove irrelevant dmesg messages]
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      a20c7f36
    • Mika Westerberg's avatar
      PCI: Open-code the two pass loop when scanning bridges · 4147c2fd
      Mika Westerberg authored
      
      
      The current scanning code is really hard to understand because it calls
      the same function in a loop where pass value is changed without any
      comments explaining it:
      
        for (pass = 0; pass < 2; pass++)
          for_each_pci_bridge(dev, bus)
            max = pci_scan_bridge(bus, dev, max, pass);
      
      Unfamiliar reader cannot tell easily what is the purpose of this loop
      without looking at internals of pci_scan_bridge().
      
      In order to make this bit easier to understand, open-code the loop in
      pci_scan_child_bus() and pci_hp_add_bridge() with added comments.
      
      No functional changes intended.
      
      Signed-off-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      4147c2fd
    • Mika Westerberg's avatar
      PCI: Move pci_hp_add_bridge() to drivers/pci/probe.c · 95e3ba97
      Mika Westerberg authored
      
      
      There is not much point of having a file with a single function in it.
      Instead we can just move pci_hp_add_bridge() to drivers/pci/probe.c and
      make it available always when PCI core is enabled.
      
      Signed-off-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
      [bhelgaas: convert printk to dev_err()]
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      95e3ba97