1. 03 6月, 2018 1 次提交
  2. 18 5月, 2018 5 次提交
    • O
      PCI/portdrv: Add generic pcie_port_find_service() · f252d062
      Oza Pawandeep 提交于
      Add generic pcie_port_find_service() routine.
      Signed-off-by: NOza Pawandeep <poza@codeaurora.org>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: NKeith Busch <keith.busch@intel.com>
      f252d062
    • O
      PCI/AER: Factor out error reporting to drivers/pci/pcie/err.c · 2e28bc84
      Oza Pawandeep 提交于
      Move the error reporting callbacks from aerdrv_core.c to err.c, where they
      can be used by DPC in addition to AER.
      
      As part of aerdrv_core.c, these callbacks were built under CONFIG_PCIEAER.
      Moving them to the new err.c means they will now be built under
      CONFIG_PCIEPORTBUS, so adjust the definition of pci_uevent_ers() to match.
      Signed-off-by: NOza Pawandeep <poza@codeaurora.org>
      [bhelgaas: in reset_link(), initialize "driver" even if CONFIG_PCIEAER is
      unset, update pci_uevent_ers() #ifdef wrapper]
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      2e28bc84
    • O
      PCI/AER: Rename error recovery interfaces to generic PCI naming · d25e28e8
      Oza Pawandeep 提交于
      Rename error recovery interfaces with "pcie_" prefix so they can be made
      non-static.
      Signed-off-by: NOza Pawandeep <poza@codeaurora.org>
      [bhelgaas: move declaration to later patch, leave functions static]
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: NKeith Busch <keith.busch@intel.com>
      d25e28e8
    • O
      PCI/AER: Handle ERR_FATAL with removal and re-enumeration of devices · 7e9084b3
      Oza Pawandeep 提交于
      PCIe ERR_FATAL errors mean the Link is unreliable.  Components on the Link
      may need to be reset to return to reliable operation (PCIe r4.0, sec
      6.2.2).  We previously handled these errors much differently depending on
      whether the platform supports Downstream Port Containment (DPC) (PCIe r4.0,
      sec 6.2.10) or not.
      
      The AER driver has historically logged the error details, called
      driver-supplied pci_error_handlers callbacks, and reset the Link.  This
      reset downstream devices, but did not remove them from the PCI subsystem,
      re-enumerate them, or call their driver .remove() or .probe() methods.
      
      DPC is different because the hardware automatically disables the Link when
      it detects ERR_FATAL, which resets downstream devices.  There's no
      opportunity for pci_error_handlers callbacks before resetting the Link.
      The DPC driver removes affected devices (which calls their driver .remove()
      methods), brings the Link back up, and re-enumerates (which calls driver
      .probe() methods).
      
      Align AER ERR_FATAL handling with DPC by resetting the Link in software,
      skipping the driver pci_error_handlers callbacks, removing the devices from
      the PCI subsystem, and re-enumerating.  The idea is that drivers and
      devices should see the same behavior for ERR_FATAL events, regardless of
      whether they're handled by AER or DPC.
      
      Here are the basic ERR_FATAL recovery steps, showing the previous AER
      behavior, the AER behavior after this patch, and the DPC behavior:
      
                                AER        AER      DPC
                                previous   new      behavior
                                --------   ---      --------
        Log error               yes        yes      yes (minimal)
        drv.error_detected()    yes        no       no
        Reset Link              yes        yes      yes
        drv.mmio_enabled()      yes        no       no
        drv.slot_reset()        yes        no       no
        drv.resume()            yes        no       no
        Remove PCI devices      no         yes      yes
          (calls drv.remove())
        Re-enumerate            no         yes      yes
          (calls drv.probe())
      
      N.B. With DPC, the Link reset happens before the driver .remove() calls,
      while with AER, the reset happens *after* the .remove() calls.  The goal is
      to eventually do the reset before .remove() for AER as well.
      Signed-off-by: NOza Pawandeep <poza@codeaurora.org>
      [bhelgaas: changelog, squash doc patch into this, remove unused
      "result_data"]
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: NKeith Busch <keith.busch@intel.com>
      7e9084b3
    • O
      PCI: Add generic pcie_wait_for_link() interface · 9f5a70f1
      Oza Pawandeep 提交于
      Clients such as hotplug and Downstream Port Containment (DPC) both need to
      wait until a link becomes active or inactive.
      
      Add a generic pcie_wait_link_active() interface and use it instead of
      duplicating the code.
      Signed-off-by: NOza Pawandeep <poza@codeaurora.org>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: NKeith Busch <keith.busch@intel.com>
      9f5a70f1
  3. 10 5月, 2018 1 次提交
  4. 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
  5. 01 4月, 2018 1 次提交
  6. 31 3月, 2018 11 次提交
    • 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
  7. 20 3月, 2018 2 次提交
  8. 12 3月, 2018 2 次提交
  9. 10 3月, 2018 1 次提交
  10. 01 3月, 2018 2 次提交
  11. 23 2月, 2018 1 次提交
  12. 31 1月, 2018 12 次提交