1. 24 7月, 2018 2 次提交
  2. 27 6月, 2018 1 次提交
    • B
      PCI: shpchp: Separate existence of SHPC and permission to use it · b03799b0
      Bjorn Helgaas 提交于
      The shpchp driver registers for all PCI bridge devices.  Its probe method
      should fail if either (1) the bridge doesn't have an SHPC or (2) the OS
      isn't allowed to use it (the platform firmware may be operating the SHPC
      itself).
      
      Separate these two tests into:
      
        - A new shpc_capable() that looks for the SHPC hardware and is applicable
          on all systems (ACPI and non-ACPI), and
      
        - A simplified acpi_get_hp_hw_control_from_firmware() that we call only
          when we already know an SHPC exists and there may be ACPI methods to
          either request permission to use it (_OSC) or transfer control to the
          OS (OSHP).
      
      acpi_get_hp_hw_control_from_firmware() is implemented when CONFIG_ACPI=y,
      but does nothing if the current platform doesn't support ACPI.
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      b03799b0
  3. 26 6月, 2018 1 次提交
  4. 05 6月, 2018 5 次提交
  5. 02 6月, 2018 5 次提交
  6. 24 5月, 2018 2 次提交
  7. 18 5月, 2018 1 次提交
  8. 08 5月, 2018 1 次提交
    • B
      PCI: pciehp: Add quirk for Command Completed errata · d22b3621
      Bjorn Helgaas 提交于
      Several PCIe hotplug controllers have errata that mean they do not set the
      Command Completed bit unless writes to the Slot Command register change
      "Control" bits.  Command Completed is never set for writes that only change
      software notification "Enable" bits.  This results in timeouts like this:
      
        pciehp 0000:00:1c.0:pcie004: Timeout on hotplug command 0x1038 (issued 65284 msec ago)
      
      When this erratum is present, avoid these timeouts by marking commands
      "completed" immediately unless they change the "Control" bits.
      
      Here's the text of the Intel erratum CF118.  We assume this applies to all
      Intel parts:
      
        CF118        PCIe Slot Status Register Command Completed bit not always
                     updated on any configuration write to the Slot Control
                     Register
      
        Problem:     For PCIe root ports (devices 0 - 10) supporting hot-plug,
                     the Slot Status Register (offset AAh) Command Completed
                     (bit[4]) status is updated under the following condition:
                     IOH will set Command Completed bit after delivering the new
                     commands written in the Slot Controller register (offset
                     A8h) to VPP. The IOH detects new commands written in Slot
                     Control register by checking the change of value for Power
                     Controller Control (bit[10]), Power Indicator Control
                     (bits[9:8]), Attention Indicator Control (bits[7:6]), or
                     Electromechanical Interlock Control (bit[11]) fields. Any
                     other configuration writes to the Slot Control register
                     without changing the values of these fields will not cause
                     Command Completed bit to be set.
      
                     The PCIe Base Specification Revision 2.0 or later describes
                     the “Slot Control Register” in section 7.8.10, as follows
                     (Reference section 7.8.10, Slot Control Register, Offset
                     18h). In hot-plug capable Downstream Ports, a write to the
                     Slot Control register must cause a hot-plug command to be
                     generated (see Section 6.7.3.2 for details on hot-plug
                     commands). A write to the Slot Control register in a
                     Downstream Port that is not hotplug capable must not cause a
                     hot-plug command to be executed.
      
                     The PCIe Spec intended that every write to the Slot Control
                     Register is a command and expected a command complete status
                     to abstract the VPP implementation specific nuances from the
                     OS software. IOH PCIe Slot Control Register implementation
                     is not fully conforming to the PCIe Specification in this
                     respect.
      
        Implication: Software checking on the Command Completed status after
                     writing to the Slot Control register may time out.
      
        Workaround:  Software can read the Slot Control register and compare the
                     existing and new values to determine if it should check the
                     Command Completed status after writing to the Slot Control
                     register.
      
      Per Sinan, the Qualcomm QDF2400 controller also does not set the Command
      Completed bit unless writes to the Slot Command register change "Control"
      bits.
      
      Link: http://www.intel.com/content/www/us/en/processors/xeon/xeon-e7-v2-spec-update.html
      Link: https://lkml.kernel.org/r/8770820b-85a0-172b-7230-3a44524e6c9f@molgen.mpg.de
      Reported-by: Paul Menzel <pmenzel+linux-pci@molgen.mpg.de>	# Lenovo X60
      Tested-by: Paul Menzel <pmenzel+linux-pci@molgen.mpg.de>	# Lenovo X60
      Signed-off-by: Sinan Kaya <okaya@codeaurora.org>		# Qcom quirk
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      d22b3621
  9. 21 4月, 2018 1 次提交
  10. 24 3月, 2018 1 次提交
    • M
      ACPI / hotplug / PCI: Check presence of slot itself in get_slot_status() · 13d3047c
      Mika Westerberg 提交于
      Mike Lothian reported that plugging in a USB-C device does not work
      properly in his Dell Alienware system.  This system has an Intel Alpine
      Ridge Thunderbolt controller providing USB-C functionality.  In these
      systems the USB controller (xHCI) is hotplugged whenever a device is
      connected to the port using ACPI-based hotplug.
      
      The ACPI description of the root port in question is as follows:
      
        Device (RP01)
        {
            Name (_ADR, 0x001C0000)
      
            Device (PXSX)
            {
                Name (_ADR, 0x02)
      
                Method (_RMV, 0, NotSerialized)
                {
                    // ...
                }
            }
      
      Here _ADR 0x02 means device 0, function 2 on the bus under root port (RP01)
      but that seems to be incorrect because device 0 is the upstream port of the
      Alpine Ridge PCIe switch and it has no functions other than 0 (the bridge
      itself).  When we get ACPI Notify() to the root port resulting from
      connecting a USB-C device, Linux tries to read PCI_VENDOR_ID from device 0,
      function 2 which of course always returns 0xffffffff because there is no
      such function and we never find the device.
      
      In Windows this works fine.
      
      Now, since we get ACPI Notify() to the root port and not to the PXSX device
      we should actually start our scan from there as well and not from the
      non-existent PXSX device.  Fix this by checking presence of the slot itself
      (function 0) if we fail to do that otherwise.
      
      While there use pci_bus_read_dev_vendor_id() in get_slot_status(), which is
      the recommended way to read Device and Vendor IDs of devices on PCI buses.
      
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=198557Reported-by: NMike Lothian <mike@fireburn.co.uk>
      Signed-off-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: stable@vger.kernel.org
      13d3047c
  11. 13 3月, 2018 1 次提交
  12. 10 3月, 2018 1 次提交
  13. 01 3月, 2018 1 次提交
  14. 23 2月, 2018 1 次提交
  15. 04 2月, 2018 1 次提交
  16. 30 1月, 2018 1 次提交
  17. 29 1月, 2018 2 次提交
  18. 27 1月, 2018 1 次提交
  19. 24 1月, 2018 1 次提交
    • L
      PCI: pciehp: Assume NoCompl+ for Thunderbolt ports · 493fb50e
      Lukas Wunner 提交于
      Certain Thunderbolt 1 controllers claim to support Command Completed events
      (value of 0b in the No Command Completed Support field of the Slot
      Capabilities register) but in reality they neither set the Command
      Completed bit in the Slot Status register nor signal a Command Completed
      interrupt:
      
        8086:1513  CV82524  [Light Ridge 4C  2010]
        8086:151a  DSL2310  [Eagle Ridge 2C  2011]
        8086:151b  CVL2510  [Light Peak 2C   2010]
        8086:1547  DSL3510  [Cactus Ridge 4C 2012]
        8086:1548  DSL3310  [Cactus Ridge 2C 2012]
        8086:1549  DSL2210  [Port Ridge 1C   2011]
      
      All known newer chips (Redwood Ridge and onwards) set No Command Completed
      Support, indicating that they do not support Command Completed events.
      
      The user-visible impact is that after unplugging such a device, 2 seconds
      elapse until pciehp is unbound.  That's because on ->remove,
      pcie_write_cmd() is called via pcie_disable_notification() and every call
      to pcie_write_cmd() takes 2 seconds (1 second for each invocation of
      pcie_wait_cmd()):
      
        [  337.942727] pciehp 0000:0a:00.0:pcie204: Timeout on hotplug command 0x1038 (issued 21176 msec ago)
        [  340.014735] pciehp 0000:0a:00.0:pcie204: Timeout on hotplug command 0x0000 (issued 2072 msec ago)
      
      That by itself has always been unpleasant, but the situation has become
      worse with commit cc27b735 ("PCI/portdrv: Turn off PCIe services during
      shutdown"):  Now pciehp is unbound on ->shutdown.  Because Thunderbolt
      controllers typically have 4 hotplug ports, every reboot and shutdown is
      now delayed by 8 seconds, plus another 2 seconds for every attached
      Thunderbolt 1 device.
      
      Thunderbolt hotplug slots are not physical slots that one inserts cards
      into, but rather logical hotplug slots implemented in silicon.  Devices
      appear beyond those logical slots once a PCI tunnel is established on top
      of the Thunderbolt Converged I/O switch.  One would expect commands written
      to the Slot Control register to be executed immediately by the silicon, so
      for simplicity we always assume NoCompl+ for Thunderbolt ports.
      
      Fixes: cc27b735 ("PCI/portdrv: Turn off PCIe services during shutdown")
      Tested-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: NLukas Wunner <lukas@wunner.de>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Cc: stable@vger.kernel.org	# v4.12+
      Cc: Sinan Kaya <okaya@codeaurora.org>
      Cc: Yehezkel Bernat <yehezkel.bernat@intel.com>
      Cc: Michael Jamet <michael.jamet@intel.com>
      Cc: Andreas Noever <andreas.noever@gmail.com>
      493fb50e
  20. 21 1月, 2018 1 次提交
    • M
      hotplug/drc-info: Add code to search ibm,drc-info property · 2fcf3ae5
      Michael Bringmann 提交于
      rpadlpar_core.c: Provide parallel routines to search the older device-
      tree properties ("ibm,drc-indexes", "ibm,drc-names", "ibm,drc-types"
      and "ibm,drc-power-domains"), or the new property "ibm,drc-info".
      
      The interface to examine the DRC information is changed from a "get"
      function that returns values for local verification elsewhere, to a
      "check" function that validates the 'name' and/or 'type' of a device
      node.  This update hides the format of the underlying device-tree
      properties, and concentrates the value checks into a single function
      without requiring the user to verify whether a search was successful.
      Signed-off-by: NMichael Bringmann <mwb@linux.vnet.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      2fcf3ae5
  21. 19 1月, 2018 1 次提交
  22. 17 1月, 2018 3 次提交
    • M
      PCI: Remove unnecessary messages for memory allocation failures · c7abb235
      Markus Elfring 提交于
      Per ebfdc409 ("checkpatch: attempt to find unnecessary 'out of memory'
      messages"), when a memory allocation fails, the memory subsystem emits
      generic "out of memory" messages (see slab_out_of_memory() for some of this
      logging).  Therefore, additional error messages in the caller don't add
      much value.
      
      Remove messages that merely report "out of memory".
      
      This preserves some messages that report additional information, e.g.,
      allocation failures that mean we drop hotplug events.
      
      This issue was detected by using the Coccinelle software.
      Signed-off-by: NMarkus Elfring <elfring@users.sourceforge.net>
      [bhelgaas: changelog, squash patches, make similar changes to acpiphp,
      cpqphp, ibmphp, keep warning when dropping hotplug event]
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      c7abb235
    • S
      PCI: ibmphp: Deprecate pci_get_bus_and_slot() · 48ec0535
      Sinan Kaya 提交于
      pci_get_bus_and_slot() is restrictive such that it assumes domain=0 as
      where a PCI device is present. This restricts the device drivers to be
      reused for other domain numbers.
      
      Getting ready to remove pci_get_bus_and_slot() function in favor of
      pci_get_domain_bus_and_slot().
      
      Hard-coding the domain parameter as 0 since the code doesn't seem to be
      ready for multiple domains.
      Signed-off-by: NSinan Kaya <okaya@codeaurora.org>
      Signed-off-by: NBjorn Helgaas <helgaas@kernel.org>
      48ec0535
    • S
      PCI: cpqhp: Deprecate pci_get_bus_and_slot() · 8658e819
      Sinan Kaya 提交于
      pci_get_bus_and_slot() is restrictive such that it assumes domain=0 as
      where a PCI device is present. This restricts the device drivers to be
      reused for other domain numbers.
      
      Getting ready to remove pci_get_bus_and_slot() function in favor of
      pci_get_domain_bus_and_slot().
      
      Hard-coding the domain number as 0. The code doesn't seem to be ready
      for multiple domains.
      Signed-off-by: NSinan Kaya <okaya@codeaurora.org>
      Signed-off-by: NBjorn Helgaas <helgaas@kernel.org>
      8658e819
  23. 19 12月, 2017 1 次提交
    • M
      PCI: hotplug: Drop checking of PCI_BRIDGE_CONTROL in *_unconfigure_device() · 0f4bd801
      Mika Westerberg 提交于
      When removing a bridge, pciehp_unconfigure_device() reads the
      PCI_BRIDGE_CONTROL byte.  If this is a surprise hot-unplug, the device is
      already gone and the read returns ~0, which pciehp_unconfigure_device()
      interprets as having PCI_BRIDGE_CTL_VGA set.  This results in failure of
      the remove operation:
      
        pciehp 0000:00:1c.0:pcie004: Slot(0): Link Down
        pciehp 0000:00:1c.0:pcie004: Slot(0): Card present
        pciehp 0000:00:1c.0:pcie004: Cannot remove display device 0000:01:00.0
      
      Because of this the hierarchy is left untouched preventing further hotplug
      operations.
      
      Now, it is not clear why the check is there in the first place and why we
      would like to prevent removing a bridge if it has PCI_BRIDGE_CTL_VGA set.
      In case of PCIe surprise hot-unplug, it would not even be possible to
      prevent the removal.
      
      Given this and the issue described above, I think it makes sense to drop
      the whole PCI_BRIDGE_CONTROL check from pciehp_unconfigure_device().  While
      there do the same for shpchp_configure_device() based on the same reasoning
      and the fact that the same bug might trigger in standard PCI hotplug as
      well.
      Signed-off-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      [bhelgaas: changelog]
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      0f4bd801
  24. 07 11月, 2017 4 次提交