1. 14 8月, 2018 2 次提交
    • M
      PCI: Match Root Port's MPS to endpoint's MPSS as necessary · 9f0e8935
      Myron Stowe 提交于
      In commit 27d868b5 ("PCI: Set MPS to match upstream bridge"), we made
      sure every device's MPS setting matches its upstream bridge, making it more
      likely that a hot-added device will work in a system with an optimized MPS
      configuration.
      
      Recently I've started encountering systems where the endpoint device's MPSS
      capability is less than its Root Port's current MPS value, thus the
      endpoint is not capable of matching its upstream bridge's MPS setting (see:
      bugzilla via "Link:" below).  This leaves the system vulnerable - the
      upstream Root Port could respond with larger TLPs than the device can
      handle, and the device will consider them to be 'Malformed'.
      
      One could use the "pci=pcie_bus_safe" kernel parameter to work around the
      issue, but that forces a user to supply a kernel parameter to get the
      system to function reliably and may end up limiting MPS settings of other
      unrelated, sub-topologies which could benefit from maintaining their larger
      values.
      
      Augment Keith's approach to include tuning down a Root Port's MPS setting
      when its hot-added endpoint device is not capable of matching it.
      
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=200527Signed-off-by: NMyron Stowe <myron.stowe@redhat.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Acked-by: NJon Mason <jdmason@kudzu.us>
      Cc: Keith Busch <keith.busch@intel.com>
      Cc: Sinan Kaya <okaya@kernel.org>
      Cc: Dongdong Liu <liudongdong3@huawei.com>
      9f0e8935
    • M
      PCI: Skip MPS logic for Virtual Functions (VFs) · 3dbe97ef
      Myron Stowe 提交于
      PCIe r4.0, sec 9.3.5.4, "Device Control Register", shows both
      Max_Payload_Size (MPS) and Max_Read_request_Size (MRRS) to be 'RsvdP' for
      VFs.  Just prior to the table it states:
      
        "PF and VF functionality is defined in Section 7.5.3.4 except where
         noted in Table 9-16.  For VF fields marked 'RsvdP', the PF setting
         applies to the VF."
      
      All of which implies that with respect to Max_Payload_Size Supported
      (MPSS), MPS, and MRRS values, we should not be paying any attention to the
      VF's fields, but rather only to the PF's.  Only looking at the PF's fields
      also logically makes sense as it's the sole physical interface to the PCIe
      bus.
      
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=200527
      Fixes: 27d868b5 ("PCI: Set MPS to match upstream bridge")
      Signed-off-by: NMyron Stowe <myron.stowe@redhat.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Cc: stable@vger.kernel.org # 4.3+
      Cc: Keith Busch <keith.busch@intel.com>
      Cc: Sinan Kaya <okaya@kernel.org>
      Cc: Dongdong Liu <liudongdong3@huawei.com>
      Cc: Jon Mason <jdmason@kudzu.us>
      3dbe97ef
  2. 11 8月, 2018 1 次提交
    • A
      PCI: Check for PCIe Link downtraining · 2d1ce5ec
      Alexandru Gagniuc 提交于
      When both ends of a PCIe Link are capable of a higher bandwidth than is
      currently in use, the Link is said to be "downtrained".  A downtrained Link
      may indicate hardware or configuration problems in the system, but it's
      hard to identify such Links from userspace.
      
      Refactor pcie_print_link_status() so it continues to always print PCIe
      bandwidth information, as several NIC drivers desire.
      
      Add a new internal __pcie_print_link_status() to emit a message only when a
      device's bandwidth is constrained by the fabric and call it from the PCI
      core for all devices, which identifies all downtrained Links.  It also
      emits messages for a few cases that are technically not downtrained, such
      as a x4 device in an open-ended x1 slot.
      Signed-off-by: NAlexandru Gagniuc <mr.nuke.me@gmail.com>
      [bhelgaas: changelog, move __pcie_print_link_status() declaration to
      drivers/pci/, rename pcie_check_upstream_link() to
      pcie_report_downtraining()]
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      2d1ce5ec
  3. 13 7月, 2018 1 次提交
    • J
      PCI: Workaround IDT switch ACS Source Validation erratum · aa667c64
      James Puthukattukaran 提交于
      Some IDT switches incorrectly flag an ACS Source Validation error on
      completions for config read requests even though PCIe r4.0, sec 6.12.1.1,
      says that completions are never affected by ACS Source Validation.  Here's
      the text of IDT 89H32H8G3-YC, erratum #36:
      
        Item #36 - Downstream port applies ACS Source Validation to Completions
        Section 6.12.1.1 of the PCI Express Base Specification 3.1 states that
        completions are never affected by ACS Source Validation.  However,
        completions received by a downstream port of the PCIe switch from a
        device that has not yet captured a PCIe bus number are incorrectly
        dropped by ACS Source Validation by the switch downstream port.
      
        Workaround: Issue a CfgWr1 to the downstream device before issuing the
        first CfgRd1 to the device.  This allows the downstream device to capture
        its bus number; ACS Source Validation no longer stops completions from
        being forwarded by the downstream port.  It has been observed that
        Microsoft Windows implements this workaround already; however, some
        versions of Linux and other operating systems may not.
      
      When doing the first config read to probe for a device, if the device is
      behind an IDT switch with this erratum:
      
        1. Disable ACS Source Validation if enabled
        2. Wait for device to become ready to accept config accesses (by using
           the Config Request Retry Status mechanism)
        3. Do a config write to the endpoint
        4. Enable ACS Source Validation (if it was enabled to begin with)
      
      The workaround suggested by IDT is basically only step 3, but we don't know
      when the device is ready to accept config requests.  That means we need to
      do config reads until we receive a non-Config Request Retry Status, which
      means we need to disable ACS SV temporarily.
      Signed-off-by: NJames Puthukattukaran <james.puthukattukaran@oracle.com>
      [bhelgaas: changelog, clean up whitespace, fold in unused variable fix
      from Anders Roxell <anders.roxell@linaro.org>]
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: NAlex Williamson <alex.williamson@redhat.com>
      aa667c64
  4. 05 6月, 2018 3 次提交
    • M
      PCI: Improve "partially hidden behind bridge" log message · e412d63d
      Mika Westerberg 提交于
      pci_scan_child_bus_extend() complains when we assign an unreachable
      secondary bus number to a bridge.  For example, given the topology below:
      
        +-1b.0-[01-39]----00.0-[02-3a]--+-00.0-[03]----00.0
                                        +-01.0-[04-39]--
                                        \-02.0-[3a]----00.0
      
      it logs the following messages:
      
        pci_bus 0000:3a: [bus 3a] partially hidden behind bridge 0000:02 [bus 02-39]
        pci_bus 0000:3a: [bus 3a] partially hidden behind bridge 0000:01 [bus 01-39]
      
      These messages are incorrect (0000:02 is a bus, not a bridge) and
      confusing.  Make the message more understandable:
      
        pci 0000:02:02.0: devices behind bridge are unusable because [bus 3a] cannot be assigned for them
      
      Also, remove the reference to CardBus, because this issue affects all
      varieties of PCI, not just CardBus.
      Suggested-by: NBjorn Helgaas <bhelgaas@google.com>
      Signed-off-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      [bhelgaas: changelog]
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      e412d63d
    • M
      PCI: Improve pci_scan_bridge() and pci_scan_bridge_extend() doc · 70f7880d
      Mika Westerberg 提交于
      It is not immediately clear what the two functions actually return so
      add kernel-doc comment explaining it a bit better.
      Suggested-by: NBjorn Helgaas <bhelgaas@google.com>
      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>
      Reviewed-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      70f7880d
    • M
      PCI: Account for all bridges on bus when distributing bus numbers · 3374c545
      Mika Westerberg 提交于
      When distributing extra bus number space to hotplug bridges for future
      extension, we don't account for the fact that there might be non-hotplug
      bridges on the bus after the hotplug bridges.  For example:
      
        01:00.0 --+- 02:00.0 (HotPlug-) -- Thunderbolt host controller
                  +- 02:01.0 (HotPlug+)
                  \- 02:02.0 (HotPlug-) -- xHCI host controller
      
      pci_scan_child_bus_extend() is supposed to distribute the remaining bus
      numbers to the hotplug bridge at 02:01.0, but only after accounting for all
      bridges on bus 02.  Since we don't check whether there's another
      non-hotplug bridge after the hotplug bridge 02:01.0, it may not leave space
      for the non-hotplug bridge:
      
        pci 0000:00:1b.0: PCI bridge to [bus 01-39]  (Root Port)
        pci 0000:01:00.0: PCI bridge to [bus 02-39]
        ...
        pci 0000:02:00.0: PCI bridge to [bus 03]
        pci 0000:02:01.0: PCI bridge to [bus 04]
        pci_bus 0000:04: [bus 04-39] extended by 0x35
        pci_bus 0000:04: bus scan returning with max=39
        pci_bus 0000:04: busn_res: [bus 04-39] end is updated to 39
        pci 0000:02:02.0: scanning [bus 00-00] behind bridge, pass 1
        pci_bus 0000:3a: scanning bus
        pci_bus 0000:3a: bus scan returning with max=3a
        pci_bus 0000:3a: busn_res: [bus 3a] end is updated to 3a
        pci_bus 0000:3a: [bus 3a] partially hidden behind bridge 0000:02 [bus 02-39]
        pci_bus 0000:3a: [bus 3a] partially hidden behind bridge 0000:01 [bus 01-39]
        pci_bus 0000:02: bus scan returning with max=3a
        pci_bus 0000:02: busn_res: [bus 02-39] end can not be updated to 3a
      
      The resulting 'lspci -t' output looks like this:
      
        +-1b.0-[01-39]----00.0-[02-3a]--+-00.0-[03]----00.0
                                   ^^   +-01.0-[04-39]--
                                        \-02.0-[3a]----00.0
                                                ^^
      The xHCI host controller behind 02:02.0 is not usable because it would have
      to be assigned bus 3a, which is not accessible through 00:1b.0.
      
      To fix this, reserve at least one bus for each bridge while scanning
      already configured bridges.  Then use this information in the second
      scan to correct the available extra bus space for hotplug bridges.
      
      After this change the 'lspci -t' output is what is expected:
      
        +-1b.0-[01-39]----00.0-[02-39]--+-00.0-[03]----00.0
                                        +-01.0-[04-38]--
                                        \-02.0-[39]----00.0
      
      The xHCI controller is now on bus 39, where it is usable.
      
      Fixes: 1c02ea81 ("PCI: Distribute available buses to hotplug-capable bridges")
      Reported-by: NMario Limonciello <mario.limonciello@dell.com>
      Signed-off-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      [bhelgaas: changelog]
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Reviewed-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Cc: stable@vger.kernel.org
      3374c545
  5. 02 6月, 2018 2 次提交
  6. 31 5月, 2018 1 次提交
  7. 08 5月, 2018 1 次提交
    • G
      PCI: Check whether bridges allow access to extended config space · 17e8f0d4
      Gilles Buloz 提交于
      Even if a device supports extended config space, i.e., it is a PCI-X Mode 2
      or a PCI Express device, the extended space may not be accessible if
      there's a conventional PCI bus in the path to it.
      
      We currently figure that out in pci_cfg_space_size() by reading the first
      dword of extended config space.  On most platforms that returns ~0 data if
      the space is inaccessible, but it may set error bits in PCI status
      registers, and on some platforms it causes exceptions that we currently
      don't recover from.
      
      For example, a PCIe-to-conventional PCI bridge treats config transactions
      with a non-zero Extended Register Address as an Unsupported Request on PCIe
      and a received Master-Abort on the destination bus (see PCI Express to
      PCI/PCI-X Bridge spec, r1.0, sec 4.1.3).
      
      A sample case is a LS1043A CPU (NXP QorIQ Layerscape) platform with the
      following bus topology:
      
        LS1043 PCIe Root Port
          -> PEX8112 PCIe-to-PCI bridge (doesn't support ext cfg on PCI side)
            -> PMC slot connector (for legacy PMC modules)
      
      With a PMC module topology as follows:
      
        PMC connector
          -> PCI-to-PCIe bridge
            -> PCIe switch (4 ports)
              -> 4 PCIe devices (one on each port)
      
      The PCIe devices on the PMC module support extended config space, but we
      can't reach it because the PEX8112 can't generate accesses to the extended
      space on its secondary bus.  Attempts to access it cause Unsupported
      Request errors, which result in synchronous aborts on this platform.
      
      To avoid these errors, check whether bridges are capable of generating
      extended config space addresses on their secondary interfaces.  If they
      can't, we restrict devices below the bridge to only the 256-byte
      PCI-compatible config space.
      Signed-off-by: NGilles Buloz <gilles.buloz@kontron.com>
      [bhelgaas: changelog, rework patch so bus_flags testing is all in
      pci_bridge_child_ext_cfg_accessible()]
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      17e8f0d4
  8. 23 4月, 2018 1 次提交
    • B
      PCI/ACPI: Request LTR control from platform before using it · af8bb9f8
      Bjorn Helgaas 提交于
      Per the PCI Firmware spec r3.2, sec 4.5, an ACPI-based OS should use _OSC
      to request control of Latency Tolerance Reporting (LTR) before using it.
      
      Request control of LTR, and if the platform does not grant control, don't
      use it.
      
      N.B. If the hardware supports LTR and the ASPM L1.2 substate but the BIOS
      doesn't support LTR in _OSC, we previously would enable ASPM L1.2.  This
      patch will prevent us from enabling ASPM L1.2 in that case.  It does not
      prevent us from enabling PCI-PM L1.2, since that doesn't depend on LTR.
      See PCIe r40, sec 5.5.1, for the L1 PM substate entry conditions.
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      af8bb9f8
  9. 01 4月, 2018 1 次提交
  10. 31 3月, 2018 1 次提交
    • B
      PCI/portdrv: Simplify PCIe feature permission checking · 02bfeb48
      Bjorn Helgaas 提交于
      Some PCIe features (AER, DPC, hotplug, PME) can be managed by either the
      platform firmware or the OS, so the host bridge driver may have to request
      permission from the platform before using them.  On ACPI systems, this is
      done by negotiate_os_control() in acpi_pci_root_add().
      
      The PCIe port driver later uses pcie_port_platform_notify() and
      pcie_port_acpi_setup() to figure out whether it can use these features.
      But all we need is a single bit for each service, so these interfaces are
      needlessly complicated.
      
      Simplify this by adding bits in the struct pci_host_bridge to show when the
      OS has permission to use each feature:
      
        + unsigned int native_aer:1;       /* OS may use PCIe AER */
        + unsigned int native_hotplug:1;   /* OS may use PCIe hotplug */
        + unsigned int native_pme:1;       /* OS may use PCIe PME */
      
      These are set when we create a host bridge, and the host bridge driver can
      clear the bits corresponding to any feature the platform doesn't want us to
      use.
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      02bfeb48
  11. 22 3月, 2018 1 次提交
  12. 20 3月, 2018 2 次提交
  13. 08 3月, 2018 1 次提交
  14. 05 3月, 2018 1 次提交
  15. 17 2月, 2018 1 次提交
    • B
      PCI: Probe for device reset support during enumeration · 5b0764ca
      Bjorn Helgaas 提交于
      Previously we called pci_probe_reset_function() in this path:
      
        pci_sysfs_init                              # late_initcall
          for_each_pci_dev(dev)
            pci_create_sysfs_dev_files(dev)
              pci_create_capabilities_sysfs(dev)
                pci_probe_reset_function
                  pci_dev_specific_reset
                  pcie_has_flr
                    pcie_capability_read_dword
      
      pci_sysfs_init() is a late_initcall, and a driver may have already claimed
      one of these devices and enabled runtime power management for it, so the
      device could already be in D3 by the time we get to pci_sysfs_init().
      
      The device itself should respond to the config read even while it's in
      D3hot, but if an upstream bridge is also in D3hot, the read won't even
      reach the device because the bridge won't forward it downstream to the
      device.  If the bridge is a PCIe port, it should complete the read as an
      Unsupported Request, which may be reported to the CPU as an exception or as
      invalid data.
      
      Avoid this case by probing for reset support from pci_init_capabilities(),
      before a driver can claim the device.  The device may be in D3hot, but any
      bridges leading to it should be in D0, so the device's config space should
      be fully accessible at that point.
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      5b0764ca
  16. 31 1月, 2018 1 次提交
  17. 27 1月, 2018 1 次提交
  18. 19 1月, 2018 1 次提交
  19. 19 12月, 2017 3 次提交
  20. 07 11月, 2017 5 次提交
    • M
      PCI: Distribute available buses to hotplug-capable bridges · 1c02ea81
      Mika Westerberg 提交于
      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: NMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      1c02ea81
    • M
      PCI: Do not allocate more buses than available in parent · a20c7f36
      Mika Westerberg 提交于
      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: NMika Westerberg <mika.westerberg@linux.intel.com>
      [bhelgaas: remove irrelevant dmesg messages]
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      a20c7f36
    • M
      PCI: Open-code the two pass loop when scanning bridges · 4147c2fd
      Mika Westerberg 提交于
      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: NMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      4147c2fd
    • M
      PCI: Move pci_hp_add_bridge() to drivers/pci/probe.c · 95e3ba97
      Mika Westerberg 提交于
      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: NMika Westerberg <mika.westerberg@linux.intel.com>
      [bhelgaas: convert printk to dev_err()]
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      95e3ba97
    • A
      PCI: Add for_each_pci_bridge() helper · 24a0c654
      Andy Shevchenko 提交于
      The following pattern is often used:
      
        list_for_each_entry(dev, &bus->devices, bus_list) {
          if (pci_is_bridge(dev)) {
            ...
          }
        }
      
      Add a for_each_pci_bridge() helper to make that code easier to write and
      read by reducing indentation level.  It also saves one or few lines of code
      in each occurrence.
      
      Convert PCI core parts here at the same time.
      Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      [bhelgaas: fold in http://lkml.kernel.org/r/20171013165352.25550-1-andriy.shevchenko@linux.intel.com]
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      24a0c654
  21. 30 8月, 2017 4 次提交
    • S
      PCI: Warn periodically while waiting for non-CRS ("device ready") status · e78e661f
      Sinan Kaya 提交于
      Add a print statement in pci_bus_wait_crs() so that user observes the
      progress of device polling instead of silently waiting for timeout to be
      reached.
      Signed-off-by: NSinan Kaya <okaya@codeaurora.org>
      [bhelgaas: check for timeout first so we don't print "waiting, giving up",
      always print time we've slept (not the actual timeout, print a "ready"
      message if we've printed a "waiting" message]
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      e78e661f
    • S
      PCI: Factor out pci_bus_wait_crs() · 6a802ef0
      Sinan Kaya 提交于
      Configuration Request Retry Status (CRS) was previously hidden inside
      pci_bus_read_dev_vendor_id().  We want to add support for CRS in other
      situations, such as waiting for a device to become ready after a Function
      Level Reset.
      
      Move CRS handling into pci_bus_wait_crs() so it can be called from other
      places.
      Signed-off-by: NSinan Kaya <okaya@codeaurora.org>
      [bhelgaas: pass pointer, not value, to pci_bus_wait_crs() so caller gets
      correct Vendor ID]
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      6a802ef0
    • S
      PCI: Add pci_bus_crs_vendor_id() to detect CRS response data · 62bc6a6f
      Sinan Kaya 提交于
      Add pci_bus_crs_vendor_id() to determine whether data returned for a config
      read of the Vendor ID indicates a Configuration Request Retry Status (CRS)
      response.
      
      Per PCIe r3.1, sec 2.3.2, this data is only returned if:
      
        - CRS Software Visibility is enabled,
        - a config read includes both bytes of the Vendor ID, and
        - the read receives a CRS completion
      Signed-off-by: NSinan Kaya <okaya@codeaurora.org>
      [bhelgaas: changelog, change name to pci_bus_crs_vendor_id(), make static
      in probe.c, use it in pci_bus_read_dev_vendor_id()]
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      62bc6a6f
    • B
      PCI: Always check for non-CRS response before timeout · 9f982756
      Bjorn Helgaas 提交于
      While waiting for a device to become ready (i.e., to return a non-CRS
      completion to a read of its Vendor ID), if we got a valid response to the
      very last read before timing out, we printed a warning and gave up on the
      device even though it was actually ready.
      
      For a typical 60s timeout, we wait about 65s (it's not exact because of the
      exponential backoff), but we treated devices that became ready between 33s
      and 65s as though they failed.
      
      Move the Device ID read later so we check whether the device is ready
      before checking for a timeout.
      
      Thanks to Sinan Kaya <okaya@codeaurora.org>, reorder reads so we always
      check device presence after sleep, since it's pointless to sleep unless we
      recheck afterwards.
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      9f982756
  22. 15 8月, 2017 1 次提交
  23. 03 8月, 2017 1 次提交
  24. 01 8月, 2017 1 次提交
  25. 03 7月, 2017 1 次提交
    • L
      PCI: Remove pci_scan_root_bus_msi() · 9ee8a1c4
      Lorenzo Pieralisi 提交于
      The pci_scan_root_bus_bridge() function allows passing a parameterized
      struct pci_host_bridge and scanning the resulting PCI bus; since the struct
      msi_controller is part of the struct pci_host_bridge and the struct
      pci_host_bridge can now be passed to pci_scan_root_bus_bridge() explicitly,
      there is no need for a scan interface with a MSI controller parameter.
      
      With all PCI host controller drivers and platform code relying on
      pci_scan_root_bus_msi() converted over to pci_scan_root_bus_bridge() the
      pci_scan_root_bus_msi() becomes obsolete and can be removed.
      Signed-off-by: NLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      9ee8a1c4
  26. 29 6月, 2017 1 次提交
    • B
      PCI: Enable ECRC only if device supports it · 675734ba
      Bjorn Helgaas 提交于
      John reported that an Intel QuickAssist crypto accelerator didn't work in a
      Dell PowerEdge R730.  The problem seems to be that we enabled ECRC when the
      device doesn't support it:
      
        85:00.0 Co-processor [0b40]: Intel Corporation DH895XCC Series QAT [8086:0435]
          Capabilities: [100 v1] Advanced Error Reporting
            AERCap: First Error Pointer: 00, GenCap- CGenEn+ ChkCap- ChkEn+
      
      1302fcf0 ("PCI: Configure *all* devices, not just hot-added ones")
      exposed the problem because it applies settings from the _HPX method to all
      devices, not just hot-added ones.  The R730 supplies an _HPX method that
      allows the kernel to enable ECRC.
      
      Only enable ECRC if the device advertises support for it.
      
      Link: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1571798
      Fixes: 1302fcf0 ("PCI: Configure *all* devices, not just hot-added ones")
      Reported-by: NJohn Mazzie <john_mazzie@dell.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      675734ba