1. Jun 27, 2023
    • Bjorn Helgaas's avatar
      Merge branch 'pci/pm' · 7e229f0e
      Bjorn Helgaas authored
      - Reduce wait time for secondary bus to be ready to speed up resume (Mika
        Westerberg)
      
      - Avoid putting EloPOS E2/S2/H2 (as well as Elo i2) PCIe Ports in D3cold
        (Ondrej Zary)
      
      - Call _REG when transitioning D-states so AML that uses the PCI config
        space OpRegion works, which fixes some ASMedia GPIO controllers (Mario
        Limonciello)
      
      * pci/pm:
        PCI/ACPI: Call _REG when transitioning D-states
        PCI/ACPI: Validate acpi_pci_set_power_state() parameter
        PCI/PM: Avoid putting EloPOS E2/S2/H2 PCIe Ports in D3cold
        PCI/PM: Shorten pci_bridge_wait_for_secondary_bus() wait time for slow links
      7e229f0e
    • Bjorn Helgaas's avatar
      Merge branch 'pci/hotplug' · db5ccb2e
      Bjorn Helgaas authored
      - Simplify Attention Button logging (Bjorn Helgaas)
      
      - Cancel bringup sequence if card is not present, to keep from blinking
        Power Indicator indefinitely (Rongguang Wei)
      
      - Reassign bridge resources if necessary for ACPI hotplug (Igor Mammedov)
      
      * pci/hotplug:
        PCI: acpiphp: Reassign resources on bridge if necessary
        PCI: pciehp: Cancel bringup sequence if card is not present
        PCI: pciehp: Simplify Attention Button logging
      db5ccb2e
    • Bjorn Helgaas's avatar
      Merge branch 'pci/enumeration' · 1abb4739
      Bjorn Helgaas authored
      - Add PCI_EXT_CAP_ID_PL_32GT define (Ben Dooks)
      
      - Propagate firmware node by calling device_set_node() for better
        modularity (Andy Shevchenko)
      
      - Discover Data Link Layer Link Active Reporting earlier so quirks can take
        advantage of it (Maciej W. Rozycki)
      
      - Use cached Data Link Layer Link Active Reporting capability in pciehp,
        powerpc/eeh, and mlx5 (Maciej W. Rozycki)
      
      - Run quirk for devices that require OS to clear Retrain Link earlier, so
        later quirks can rely on it (Maciej W. Rozycki)
      
      - Export pcie_retrain_link() for use outside ASPM (Maciej W. Rozycki)
      
      - Add Data Link Layer Link Active Reporting as another way for
        pcie_retrain_link() to determine the link is up (Maciej W. Rozycki)
      
      - Work around link training failures (especially on the ASMedia ASM2824
        switch) by training first at 2.5GT/s and then attempting higher rates
        (Maciej W. Rozycki)
      
      * pci/enumeration:
        PCI: Add failed link recovery for device reset events
        PCI: Work around PCIe link training failures
        PCI: Use pcie_wait_for_link_status() in pcie_wait_for_link_delay()
        PCI: Add support for polling DLLLA to pcie_retrain_link()
        PCI: Export pcie_retrain_link() for use outside ASPM
        PCI: Export PCIe link retrain timeout
        PCI: Execute quirk_enable_clear_retrain_link() earlier
        PCI/ASPM: Factor out waiting for link training to complete
        PCI/ASPM: Avoid unnecessary pcie_link_state use
        PCI/ASPM: Use distinct local vars in pcie_retrain_link()
        net/mlx5: Rely on dev->link_active_reporting
        powerpc/eeh: Rely on dev->link_active_reporting
        PCI: pciehp: Rely on dev->link_active_reporting
        PCI: Initialize dev->link_active_reporting earlier
        PCI: of: Propagate firmware node by calling device_set_node()
        PCI: Add PCI_EXT_CAP_ID_PL_32GT define
      
      # Conflicts:
      #	drivers/pci/pcie/aspm.c
      1abb4739
    • Bjorn Helgaas's avatar
      Merge branch 'pci/aspm' · 0f32114e
      Bjorn Helgaas authored
      - Disable ASPM on MFD function removal to avoid use-after-free (Ding Hui)
      
      - Tighten up pci_enable_link_state() and pci_disable_link_state()
        interfaces so they don't enable/disable states the driver didn't specify
        (Ajay Agarwal)
      
      - Avoid link retraining race that can happen if ASPM sets link control
        parameters while the link is in the midst of training for some other
        reason (Ilpo Järvinen)
      
      * pci/aspm:
        PCI/ASPM: Avoid link retraining race
        PCI/ASPM: Factor out pcie_wait_for_retrain()
        PCI/ASPM: Return 0 or -ETIMEDOUT from  pcie_retrain_link()
        PCI/ASPM: Remove unnecessary ASPM_STATE_L1SS check
        PCI/ASPM: Rename L1.2-specific functions from 'l1ss' to 'l12'
        PCI/ASPM: Set ASPM_STATE_L1 when driver enables L1.1 or L1.2
        PCI/ASPM: Set only ASPM_STATE_L1 when driver enables L1
        PCI/ASPM: Disable only ASPM_STATE_L1 when driver disables L1
        PCI/ASPM: Disable ASPM on MFD function removal to avoid use-after-free
      0f32114e
    • Bjorn Helgaas's avatar
      Merge branch 'pci/aer' · a274a4e6
      Bjorn Helgaas authored
      - Unexport pci_save_aer_state() since it's only used in drivers/pci/ (Bjorn
        Helgaas)
      
      - Drop recommendation for drivers to configure AER Capability, since the
        PCI core does this for all devices (Dave Jiang, Bjorn Helgaas)
      
      * pci/aer:
        Documentation: PCI: Tidy AER documentation
        Documentation: PCI: Update cross references to .rst files
        Documentation: PCI: Drop recommendation to configure AER Capability
        PCI: Unexport pci_save_aer_state()
      a274a4e6
  2. Jun 24, 2023
  3. Jun 21, 2023
  4. Jun 20, 2023
  5. Jun 15, 2023
  6. Jun 13, 2023
  7. Jun 07, 2023
  8. Jun 01, 2023
  9. May 25, 2023
    • Igor Mammedov's avatar
      PCI: acpiphp: Reassign resources on bridge if necessary · 40613da5
      Igor Mammedov authored
      When using ACPI PCI hotplug, hotplugging a device with large BARs may fail
      if bridge windows programmed by firmware are not large enough.
      
      Reproducer:
        $ qemu-kvm -monitor stdio -M q35  -m 4G \
            -global ICH9-LPC.acpi-pci-hotplug-with-bridge-support=on \
            -device id=rp1,pcie-root-port,bus=pcie.0,chassis=4 \
            disk_image
      
       wait till linux guest boots, then hotplug device:
         (qemu) device_add qxl,bus=rp1
      
       hotplug on guest side fails with:
         pci 0000:01:00.0: [1b36:0100] type 00 class 0x038000
         pci 0000:01:00.0: reg 0x10: [mem 0x00000000-0x03ffffff]
         pci 0000:01:00.0: reg 0x14: [mem 0x00000000-0x03ffffff]
         pci 0000:01:00.0: reg 0x18: [mem 0x00000000-0x00001fff]
         pci 0000:01:00.0: reg 0x1c: [io  0x0000-0x001f]
         pci 0000:01:00.0: BAR 0: no space for [mem size 0x04000000]
         pci 0000:01:00.0: BAR 0: failed to assign [mem size 0x04000000]
         pci 0000:01:00.0: BAR 1: no space for [mem size 0x04000000]
         pci 0000:01:00.0: BAR 1: failed to assign [mem size 0x04000000]
         pci 0000:01:00.0: BAR 2: assigned [mem 0xfe800000-0xfe801fff]
         pci 0000:01:00.0: BAR 3: assigned [io  0x1000-0x101f]
         qxl 0000:01:00.0: enabling device (0000 -> 0003)
         Unable to create vram_mapping
         qxl: probe of 0000:01:00.0 failed with error -12
      
      However when using native PCIe hotplug
        '-global ICH9-LPC.acpi-pci-hotplug-with-bridge-support=off'
      it works fine, since kernel attempts to reassign unused resources.
      
      Use the same machinery as native PCIe hotplug to (re)assign resources.
      
      Link: https://lore.kernel.org/r/20230424191557.2464760-1-imammedo@redhat.com
      
      
      Signed-off-by: default avatarIgor Mammedov <imammedo@redhat.com>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Acked-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Acked-by: default avatarRafael J. Wysocki <rafael@kernel.org>
      Cc: stable@vger.kernel.org
      40613da5
    • Rongguang Wei's avatar
      PCI: pciehp: Cancel bringup sequence if card is not present · e8afd0d9
      Rongguang Wei authored
      If a PCIe hotplug slot has an Attention Button, the normal hot-add flow is:
      
        - Slot is empty and slot power is off
        - User inserts card in slot and presses Attention Button
        - OS blinks Power Indicator for 5 seconds
        - After 5 seconds, OS turns on Power Indicator, turns on slot power, and
          enumerates the device
      
      Previously, if a user pressed the Attention Button on an *empty* slot,
      pciehp logged the following messages and blinked the Power Indicator
      until a second button press:
      
        [0.000] pciehp: Button press: will power on in 5 sec
        [0.001] # Power Indicator starts blinking
        [5.001] # 5 second timeout; slot is empty, so we should cancel the
                  request to power on and turn off Power Indicator
      
        [7.000] # Power Indicator still blinking
        [8.000] # possible card insertion
        [9.000] pciehp: Button press: canceling request to power on
      
      The first button press incorrectly left the slot in BLINKINGON_STATE, so
      the second was interpreted as a "cancel power on" event regardless of
      whether a card was present.
      
      If the slot is empty, turn off the Power Indicator and return from
      BLINKINGON_STATE to OFF_STATE after 5 seconds, effectively canceling the
      request to power on.  Putting the slot in OFF_STATE also means the second
      button press will correctly request a slot power on if the slot is
      occupied.
      
      [bhelgaas: commit log]
      Link: https://lore.kernel.org/r/20230512021518.336460-1-clementwei90@163.com
      Fixes: d331710e
      
       ("PCI: pciehp: Become resilient to missed events")
      Suggested-by: default avatarLukas Wunner <lukas@wunner.de>
      Signed-off-by: default avatarRongguang Wei <weirongguang@kylinos.cn>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: default avatarLukas Wunner <lukas@wunner.de>
      e8afd0d9
    • Bjorn Helgaas's avatar
      PCI: pciehp: Simplify Attention Button logging · 5054133a
      Bjorn Helgaas authored
      Previously, pressing the Attention Button always logged two lines, the
      first from pciehp_ist() and the second from pciehp_handle_button_press():
      
        Attention button pressed
        Powering on due to button press
      
      Since pciehp_handle_button_press() always logs the more detailed message,
      remove the generic "Attention button pressed" message.  Reword the
      pciehp_handle_button_press() to be of the form:
      
        Button press: will power on in 5 sec
        Button press: will power off in 5 sec
        Button press: canceling request to power on
        Button press: canceling request to power off
        Button press: ignoring invalid state %#x
      
      Link: https://lore.kernel.org/r/20230522214051.619337-1-helgaas@kernel.org
      
      
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: default avatarLukas Wunner <lukas@wunner.de>
      5054133a
  10. May 19, 2023