1. 10 5月, 2018 1 次提交
  2. 08 5月, 2018 1 次提交
    • A
      PCI/AER: Unify error bit printing for native and CPER reporting · 5d0b401f
      Alexandru Gagniuc 提交于
      AER errors can be reported natively (Linux AER driver fields interrupts and
      reads error state directly from hardware) or via the ACPI/APEI/GHES/CPER
      path (platform firmware reads error state from hardware and sends it to
      Linux via ACPI interfaces).
      
      Previously the same error would produce different output depending on
      whether it was reported natively or via ACPI.  The CPER path resulted in
      hard-to-understand messages, without a prefix. Instead use
      __aer_print_error() for both native AER and CPER to provide a more
      consistent log format.
      Signed-off-by: NAlexandru Gagniuc <mr.nuke.me@gmail.com>
      [bhelgaas: changelog]
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      5d0b401f
  3. 11 4月, 2018 2 次提交
    • D
      PCI: Remove messages about reassigning resources · adf58458
      Desnes A. Nunes do Rosario 提交于
      When reassigning device resources to increase their alignment, e.g.,
      because of a "pci=resource_alignment=" kernel parameter or because the
      platform aligns resources to its page size, we previously emitted messages
      like this:
      
        pci 0000:00:00.0: Disabling memory decoding and releasing memory resources
        pci 0000:00:00.0: disabling bridge mem windows
      
      These messages don't convey any useful information, so remove them.
      
      Fixes: 38274637 ("powerpc/powernv: Override pcibios_default_alignment() to force PCI devices to be page aligned")
      Signed-off-by: NDesnes A. Nunes do Rosario <desnesn@linux.vnet.ibm.com>
      [bhelgaas: changelog]
      Signed-off-by: NBjorn Helgaas <helgaas@kernel.org>
      adf58458
    • S
      PCI: Mark Broadcom HT1100 and HT2000 Root Port Extended Tags as broken · 1b30dfd3
      Sinan Kaya 提交于
      Per PCIe r3.1, sec 2.2.6.2 and 7.8.4, a Requester may not use 8-bit Tags
      unless its Extended Tag Field Enable is set, but all Receivers/Completers
      must handle 8-bit Tags correctly regardless of their Extended Tag Field
      Enable.
      
      Some devices do not handle 8-bit Tags as Completers, so add a quirk for
      them.  If we find such a device, we disable Extended Tags for the entire
      hierarchy to make peer-to-peer DMA possible.
      
      The Broadcom HT1100/HT2000/HT2100 seems to have issues with handling 8-bit
      tags.  Mark it as broken.
      
      This fixes Xorg hangs and unresponsive keyboards with errors like this:
      
        radeon 0000:06:00.0: GPU lockup (current fence id 0x000000000000000e last fence id 0x0000000000000
        [drm:r600_ring_test [radeon]] *ERROR* radeon: ring 0 test failed (scratch(0x8504)=0xCAFEDEAD)
        [drm:r600_resume [radeon]] *ERROR* r600 startup failed on resume
      
      Fixes: 60db3a4d ("PCI: Enable PCIe Extended Tags if supported")
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=196197Signed-off-by: NSinan Kaya <okaya@codeaurora.org>
      Signed-off-by: NBjorn Helgaas <helgaas@kernel.org>
      CC: stable@vger.kernel.org	# v4.11: 62ce94a7 PCI: Mark Broadcom HT2100 Root Port Extended Tags as broken
      CC: stable@vger.kernel.org	# v4.11
      1b30dfd3
  4. 04 4月, 2018 3 次提交
  5. 03 4月, 2018 13 次提交
  6. 01 4月, 2018 2 次提交
  7. 31 3月, 2018 15 次提交
    • M
      PCI/DPC: Do not enable DPC if AER control is not allowed by the BIOS · 4e5fad42
      Mika Westerberg 提交于
      Commit eed85ff4 ("PCI/DPC: Enable DPC only if AER is available") made
      DPC control dependent whether AER is enabled in the OS.  However, it does
      not take into account situations where BIOS has not given OS control of
      AER:
      
        acpi PNP0A08:00: _OSC: OS supports [ExtendedConfig ASPM ClockPM Segments MSI]
        acpi PNP0A08:00: _OSC: platform does not support [AER]
        acpi PNP0A08:00: _OSC: OS now controls [PCIeHotplug PME PCIeCapability]
      
      I think here it is better not to enable DPC even if the capability is
      available because then it would be against what "Determination of DPC
      Control" note in PCIe 4.0 sec 6.1.10 recommends.
      Signed-off-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: NBjorn Helgaas <helgaas@kernel.org>
      4e5fad42
    • F
      PCI/AER: Use cached AER Capability offset · f0553ba0
      Frederick Lawler 提交于
      Replace pci_find_ext_capability(..., PCI_EXT_CAP_ID_ERR) calls with
      pci_dev->aer_cap.
      
      pci_dev->aer_cap is initialized in pci_init_capabilities(), which happens
      before any of these users of the AER Capability.
      Signed-off-by: NFrederick Lawler <fred@fredlawl.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      f0553ba0
    • B
      PCI/portdrv: Rename and reverse sense of pcie_ports_auto · d850882b
      Bjorn Helgaas 提交于
      The platform may restrict the OS's use of PCIe services, e.g., via the ACPI
      _OSC method.  The user may use "pcie_ports=native" to force the port driver
      to use PCIe services even if the platform asked us not to.
      
      The "pcie_ports=native" parameter determines the setting of
      pcie_ports_auto.  Rename this to pcie_ports_native and reverse the
      sense to simplify the code.
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      d850882b
    • B
      PCI/portdrv: Encapsulate pcie_ports_auto inside the port driver · 842b447f
      Bjorn Helgaas 提交于
      "pcie_ports_auto" is only used inside the PCIe port driver itself, so
      move it from include/linux/pci.h to portdrv.h so it's not visible to the
      whole kernel.
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      842b447f
    • B
      PCI/portdrv: Remove unnecessary "pcie_ports=auto" parameter · 4c0fd764
      Bjorn Helgaas 提交于
      The "pcie_ports=auto" parameter set pcie_ports_disabled and pcie_ports_auto
      to their compiled-in defaults, so specifying the parameter is the same as
      not using it at all.
      
      Remove the "pcie_ports=auto" parameter and update the documentation.
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      4c0fd764
    • B
      PCI/portdrv: Remove "pcie_hp=nomsi" kernel parameter · 1e447c57
      Bjorn Helgaas 提交于
      7570a333 ("PCI: Add pcie_hp=nomsi to disable MSI/MSI-X for pciehp
      driver") added the "pcie_hp=nomsi" kernel parameter to work around this
      error on shutdown:
      
        irq 16: nobody cared (try booting with the "irqpoll" option)
        Pid: 1081, comm: reboot Not tainted 3.2.0 #1
        ...
        Disabling IRQ #16
      
      This happened on an unspecified system (possibly involving the Integrated
      Device Technology, Inc. Device 807f bridge) where "an un-wanted interrupt
      is generated when PCI driver switches from MSI/MSI-X to INTx while shutting
      down the device."
      
      The implication was that the device was buggy, but it is normal for a
      device to use INTx after MSI/MSI-X have been disabled.  The only problem
      was that the driver was still attached and it wasn't prepared for INTx
      interrupts.  Prarit Bhargava fixed this issue with fda78d7a ("PCI/MSI:
      Stop disabling MSI/MSI-X in pci_device_shutdown()").
      
      There is no automated way to set this parameter, so it's not very useful
      for distributions or end users.  It's really only useful for debugging, and
      we have "pci=nomsi" for that purpose.
      
      Revert 7570a333 to remove the "pcie_hp=nomsi" parameter.
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      CC: MUNEDA Takahiro <muneda.takahiro@jp.fujitsu.com>
      CC: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
      CC: Prarit Bhargava <prarit@redhat.com>
      1e447c57
    • B
      PCI/portdrv: Remove unnecessary include of <linux/pci-aspm.h> · 1b64cb87
      Bjorn Helgaas 提交于
      portdrv_pci.c doesn't use anything from <linux/pci-aspm.h>.  Remove the
      include of it.  No functional change intended.
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      1b64cb87
    • 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
    • B
      PCI/portdrv: Remove unused PCIE_PORT_SERVICE_VC · 168f3ae5
      Bjorn Helgaas 提交于
      No driver registers for PCIE_PORT_SERVICE_VC, so remove it.
      
      This removes the VC "service" files from /sys/bus/pci_express/devices,
      e.g., 0000:07:00.0:pcie108, 0000:08:04.0:pcie208 (all the files that
      contained "8" as the last digit of the "pcieXXX" part).  The port driver
      created these files for PCIe port devices that have a VC Capability.
      
      Since this reduces PCIE_PORT_DEVICE_MAXSERVICES and moves DPC down into the
      spot where VC used to be, the DPC sysfs files will now be named "pcieXX8".
      I don't think there's anything useful userspace can do with those files, so
      I hope nobody cares about these filenames.
      
      There is no VC driver that calls pcie_port_service_register(), so there
      never was a /sys/bus/pci_express/drivers/vc directory.
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      168f3ae5
    • B
      PCI/portdrv: Remove pcie_port_bus_type link order dependency · c6c889d9
      Bjorn Helgaas 提交于
      The pcie_port_bus_type must be registered before drivers that depend on it
      can be registered.  Those drivers include:
      
        pcied_init()                # PCIe native hotplug driver
        aer_service_init()          # AER driver
        dpc_service_init()          # DPC driver
        pcie_pme_service_init()     # PME driver
      
      Previously we registered pcie_port_bus_type from pcie_portdrv_init(), a
      device_initcall.  The callers of pcie_port_service_register() (above) are
      also device_initcalls.  This is fragile because the device_initcall
      ordering depends on link order, which is not explicit.
      
      Register pcie_port_bus_type from pci_driver_init() along with pci_bus_type.
      This removes the link order dependency between portdrv and the pciehp, AER,
      DPC, and PCIe PME drivers.
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      c6c889d9
    • B
      PCI/portdrv: Disable port driver in compat mode · 79a01119
      Bjorn Helgaas 提交于
      The "pcie_ports=compat" kernel parameter sets pcie_ports_disabled, which is
      intended to disable the PCIe port driver.  But even when it was disabled,
      we registered pcie_portdriver so we could work around a BIOS PME issue (see
      fe31e697 ("PCI/PCIe: Clear Root PME Status bits early during system
      resume")).
      
      Registering the driver meant that the pcie_portdrv_probe() path called
      pci_enable_device(), pci_save_state(), pm_runtime_set_autosuspend_delay(),
      pm_runtime_use_autosuspend(), etc., even when the driver was disabled.
      
      We've since moved the BIOS PME workaround from the port driver to the core,
      so stop registering the PCIe port driver in compat mode.
      
      This means "pcie_ports=compat" will now be basically the same as turning
      off CONFIG_PCIEPORTBUS completely.
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      79a01119
    • B
      PCI/PM: Clear PCIe PME Status bit for Root Complex Event Collectors · 3620c714
      Bjorn Helgaas 提交于
      Per PCIe r4.0, sec 6.1.6, Root Complex Event Collectors can generate PME
      interrupts on behalf of Root Complex Integrated Endpoints.
      
      Linux does not currently enable PME interrupts from RC Event Collectors,
      but fe31e697 ("PCI/PCIe: Clear Root PME Status bits early during system
      resume") suggests PME interrupts may be enabled by the platform for ACPI-
      based runtime wakeup.
      
      Clear the PCIe PME Status bit for Root Complex Event Collectors during
      resume, just like we already do for Root Ports.
      
      If the BIOS enables PME interrupts for an event collector and neglects to
      clear the status bit on resume, this change should fix the same bug as
      fe31e697 (PMEs not working after waking from a sleep state), but for
      Root Complex Integrated Endpoints.
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      3620c714
    • T
      PCI: Add pcie_bandwidth_capable() to compute max supported link bandwidth · b852f63a
      Tal Gilboa 提交于
      Add pcie_bandwidth_capable() to compute the max link bandwidth supported by
      a device, based on the max link speed and width, adjusted by the encoding
      overhead.
      
      The maximum bandwidth of the link is computed as:
      
        max_link_width * max_link_speed * (1 - encoding_overhead)
      
      2.5 and 5.0 GT/s links use 8b/10b encoding, which reduces the raw bandwidth
      available by 20%; 8.0 GT/s and faster links use 128b/130b encoding, which
      reduces it by about 1.5%.
      
      The result is in Mb/s, i.e., megabits/second, of raw bandwidth.
      Signed-off-by: NTal Gilboa <talgi@mellanox.com>
      [bhelgaas: add 16 GT/s, adjust for pcie_get_speed_cap() and
      pcie_get_width_cap() signatures, don't export outside drivers/pci]
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      b852f63a
    • T
      PCI: Add pcie_get_width_cap() to find max supported link width · c70b65fb
      Tal Gilboa 提交于
      Add pcie_get_width_cap() to find the max link width supported by a device.
      Change max_link_width_show() to use pcie_get_width_cap().
      Signed-off-by: NTal Gilboa <talgi@mellanox.com>
      [bhelgaas: return width directly instead of error and *width, don't export
      outside drivers/pci]
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: NTariq Toukan <tariqt@mellanox.com>
      c70b65fb
    • T
      PCI: Add pcie_get_speed_cap() to find max supported link speed · 6cf57be0
      Tal Gilboa 提交于
      Add pcie_get_speed_cap() to find the max link speed supported by a device.
      Change max_link_speed_show() to use pcie_get_speed_cap().
      Signed-off-by: NTal Gilboa <talgi@mellanox.com>
      [bhelgaas: return speed directly instead of error and *speed, don't export
      outside drivers/pci]
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: NTariq Toukan <tariqt@mellanox.com>
      6cf57be0
  8. 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
  9. 23 3月, 2018 1 次提交
  10. 22 3月, 2018 1 次提交