1. 05 Oct, 2022 18 commits
    • Bjorn Helgaas's avatar
      Merge branch 'remotes/lorenzo/pci/mediatek' · 7cb0a666
      Bjorn Helgaas authored
      - Rename the pcie-mediatek-gen3 driver from 'mtk-pcie' to 'mtk-pcie-gen3'
        so it can coexist with the pcie-mediatek driver, which also uses
        'mtk-pcie' (Felix Fietkau)
      
      * remotes/lorenzo/pci/mediatek:
        PCI: mediatek-gen3: Change driver name to mtk-pcie-gen3
      7cb0a666
    • Bjorn Helgaas's avatar
      Merge branch 'remotes/lorenzo/pci/dwc' · fefb75d8
      Bjorn Helgaas authored
      - Use dmam_alloc_coherent() instead of dma_map_page() to allocate the MSI
        target page, which means dwc drivers will work even when ZONE_DMA32 is
        disabled (Will McVicker)
      
      - If we can't allocate an MSI target page with a 32-bit address, try
        allocating one with a 64-bit address (Will McVicker)
      
      - Switch from of_gpio_named_count() to generic gpiod_count() (Andy
        Shevchenko)
      
      - Add support for i.MX8MP PCIe (Richard Zhu)
      
      - Fix the Freescale i.MX8 PHY driver, which had interchanged the phy_init()
        and phy_power_on() interfaces (Richard Zhu)
      
      * remotes/lorenzo/pci/dwc:
        phy: freescale: imx8m-pcie: Fix the wrong order of phy_init() and phy_power_on()
        PCI: imx6: Add i.MX8MP PCIe support
        PCI: dwc: Replace of_gpio_named_count() by gpiod_count()
        PCI: dwc: Drop dependency on ZONE_DMA32
      fefb75d8
    • Bjorn Helgaas's avatar
      Merge branch 'remotes/lorenzo/pci/dt' · 3de810ac
      Bjorn Helgaas authored
      - Add MT8188 and MT8195 to mediatek-gen3 DT binding (Jianjun Wang)
      
      - Add 'clock-names' back to fu740 DT binding (Conor Dooley)
      
      - Add 'clocks', 'clock-names', 'dma-ranges' to microchip DT binding (Conor
        Dooley)
      
      - Add 'aggre0' and 'aggre1' clocks to qcom DT binding (Krishna chaitanya
        chundru)
      
      * remotes/lorenzo/pci/dt:
        dt-bindings: pci: QCOM Add missing sc7280 aggre0, aggre1 clocks
        dt-bindings: PCI: microchip,pcie-host: fix missing dma-ranges
        dt-bindings: PCI: microchip,pcie-host: fix missing clocks properties
        dt-bindings: PCI: fu740-pci: fix missing clock-names
        dt-bindings: PCI: mediatek-gen3: Add support for MT8188 and MT8195
      3de810ac
    • Bjorn Helgaas's avatar
      Merge branch 'remotes/lorenzo/pci/bridge-emul' · 84aabff8
      Bjorn Helgaas authored
      - In an emulated PCI bridge, set Capability offsets so they match the
        hardware offsets shown by U-Boot (Pali Rohár)
      
      * remotes/lorenzo/pci/bridge-emul:
        PCI: pci-bridge-emul: Set position of PCI capabilities to real HW value
      84aabff8
    • Bjorn Helgaas's avatar
      Merge branch 'remotes/lorenzo/pci/apple' · 9d17becd
      Bjorn Helgaas authored
      - Switch from gpiod_get_from_of_node() to generic devm GPIO API (Dmitry
        Torokhov)
      
      * remotes/lorenzo/pci/apple:
        PCI: apple: Do not leak reset GPIO on unbind/unload/error
      9d17becd
    • Bjorn Helgaas's avatar
      Merge branch 'remotes/lorenzo/pci/aardvark' · ec6daf25
      Bjorn Helgaas authored
      - Emulate the PCI Bridge Subsystem Vendor ID (Pali Rohár)
      
      * remotes/lorenzo/pci/aardvark:
        PCI: aardvark: Add support for PCI Bridge Subsystem Vendor ID on emulated bridge
      ec6daf25
    • Bjorn Helgaas's avatar
      Merge branch 'pci/resource' · 99e2c73d
      Bjorn Helgaas authored
      - Distribute resources to unconfigured hotplug bridges at boot-time (not
        just when hot-adding such a bridge), which makes hot-adding devices to
        docks work (Mika Westerberg)
      
      - Fix the "revert to firmware assignment" code so we do the revert only if
        the address is actually reachable.  Previously we sometimes assigned
        addresses that could not be reached via upstream bridges (Maciej W.
        Rozycki)
      
      * pci/resource:
        PCI: Sanitise firmware BAR assignments behind a PCI-PCI bridge
        PCI: Fix typo in pci_scan_child_bus_extend()
        PCI: Fix whitespace and indentation
        PCI: Distribute available resources for root buses, too
        PCI: Move pci_assign_unassigned_root_bus_resources()
        PCI: Pass available buses even if the bridge is already configured
        PCI: Fix used_buses calculation in pci_scan_child_bus_extend()
      99e2c73d
    • Bjorn Helgaas's avatar
      Merge branch 'pci/rebar' · c3acb566
      Bjorn Helgaas authored
      - Expose a sysfs interface for configuring Resizable BARs so we can resize
        BARs before assigning devices to a VM through VFIO (Alex Williamson)
      
      * pci/rebar:
        PCI: Expose PCIe Resizable BAR support via sysfs
      c3acb566
    • Bjorn Helgaas's avatar
      Merge branch 'pci/pm' · 034f93fc
      Bjorn Helgaas authored
      - Cache the PTM capability offset instead of searching for it every time
        (Bjorn Helgaas)
      
      - Separate PTM configuration from PTM enable (Bjorn Helgaas)
      
      - Add pci_suspend_ptm() and pci_resume_ptm() to disable and re-enable PTM
        on suspend/resume so some Root Ports can safely enter a lower-power PM
        state (Bjorn Helgaas)
      
      - Disable PTM for all devices during suspend; previously we only did this
        for Root Ports and even then only in certain cases (Bjorn Helgaas)
      
      - Simplify pci_pm_suspend_noirq() (Rajvi Jingar)
      
      - Reduce the delay after transitions to/from D3hot by using usleep_range()
        instead of msleep(), which reduces the typical delay from 19ms to 10ms
        (Sajid Dalvi, Will McVicker)
      
      * pci/pm:
        PCI/PM: Reduce D3hot delay with usleep_range()
        PCI/PM: Simplify pci_pm_suspend_noirq()
        PCI/PM: Always disable PTM for all devices during suspend
        PCI/PTM: Consolidate PTM interface declarations
        PCI/PTM: Reorder functions in logical order
        PCI/PTM: Preserve RsvdP bits in PTM Control register
        PCI/PTM: Move pci_ptm_info() body into its only caller
        PCI/PTM: Add pci_suspend_ptm() and pci_resume_ptm()
        PCI/PTM: Separate configuration and enable
        PCI/PTM: Add pci_upstream_ptm() helper
        PCI/PTM: Cache PTM Capability offset
      034f93fc
    • Bjorn Helgaas's avatar
      Merge branch 'pci/msi' · 519e5121
      Bjorn Helgaas authored
      - Correct a typo in 71020a3c ('PCI/MSI: Use msi_add_msi_desc()') that
        reversed the sense of 'can_mask' in msi_add_msi_desc() (Josef Johansson)
      
      * pci/msi:
        PCI/MSI: Correct 'can_mask' test in msi_add_msi_desc()
      519e5121
    • Bjorn Helgaas's avatar
      Merge branch 'pci/dpc' · f9538e27
      Bjorn Helgaas authored
      - Work around a BIOS defect that makes some Intel Root Ports report an RP
        PIO log size of zero (Mika Westerberg)
      
      * pci/dpc:
        PCI/DPC: Quirk PIO log size for certain Intel Root Ports
      f9538e27
    • Bjorn Helgaas's avatar
      Merge branch 'pci/aspm' · c1c2d892
      Bjorn Helgaas authored
      - Save L1 PM Substates Capability across suspend/resume so L1SS keeps
        working after resume (Vidya Sagar)
      
      - If device lacks L1 PM Substates Capability, don't read junk and treat it
        as such a Capability (Bjorn Helgaas)
      
      - Fix the LTR_L1.2_THRESHOLD computation, which previously configured the
        threshold for entering L1.2 to be lower than intended, so L1.2 could be
        used when it shouldn't be (Bjorn Helgaas)
      
      * pci/aspm:
        PCI/ASPM: Correct LTR_L1.2_THRESHOLD computation
        PCI/ASPM: Ignore L1 PM Substates if device lacks capability
        PCI/ASPM: Factor out L1 PM Substates configuration
        PCI/ASPM: Save L1 PM Substates Capability for suspend/resume
        PCI/ASPM: Refactor L1 PM Substates Control Register programming
      c1c2d892
    • Alex Williamson's avatar
      PCI: Expose PCIe Resizable BAR support via sysfs · 91fa1277
      Alex Williamson authored
      Add a simple sysfs interface to Resizable BAR support, largely for the
      purposes of assigning such devices to a VM through VFIO.  Resizable BARs
      present a difficult feature to expose to a VM through emulation, as
      resizing a BAR is done on the host.  It can fail, and often does, but we
      have no means via emulation of a PCIe REBAR capability to handle the error
      cases.
      
      A vfio-pci specific ioctl interface is also cumbersome as there are often
      multiple devices within the same bridge aperture and handling them is a
      challenge.  In the interface proposed here, expanding a BAR potentially
      requires such devices to be soft-removed during the resize operation and
      rescanned after, in order for all the necessary resources to be released.
      A pci-sysfs interface is also more universal than a vfio specific
      interface.
      
      Please see the ABI documentation update for usage.
      
      Link: https://lore.kernel.org/r/166336088796.3597940.14973499936692558556.stgit@omenSigned-off-by: default avatarAlex Williamson <alex.williamson@redhat.com>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
      Cc: Krzysztof Wilczyński <kw@linux.com>
      91fa1277
    • Bjorn Helgaas's avatar
      PCI/ASPM: Correct LTR_L1.2_THRESHOLD computation · 7afeb84d
      Bjorn Helgaas authored
      80d7d7a9 ("PCI/ASPM: Calculate LTR_L1.2_THRESHOLD from device
      characteristics") replaced a fixed value (163840ns) with one computed from
      T_POWER_OFF, Common_Mode_Restore_Time, etc., but it encoded the
      LTR_L1.2_THRESHOLD value incorrectly.
      
      This is especially a problem for small thresholds, e.g., 63ns fell into the
      "threshold_ns < 1024" case and was encoded as 32ns:
      
        LTR_L1.2_THRESHOLD_Scale = 1 (multiplier is 32ns)
        LTR_L1.2_THRESHOLD_Value = 63 >> 5 = 1
        LTR_L1.2_THRESHOLD       = multiplier * value = 32ns * 1 = 32ns
      
      Correct the algorithm to encode all times of 1023ns (0x3ff) or smaller
      exactly and larger times conservatively (the encoded threshold is never
      smaller than was requested).  This reduces the chance of entering L1.2
      when the device can't tolerate the exit latency.
      
      Fixes: 80d7d7a9 ("PCI/ASPM: Calculate LTR_L1.2_THRESHOLD from device characteristics")
      Link: https://lore.kernel.org/r/20221005025809.2247547-4-helgaas@kernel.orgSigned-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: default avatarKuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
      7afeb84d
    • Bjorn Helgaas's avatar
      PCI/ASPM: Ignore L1 PM Substates if device lacks capability · cfc00286
      Bjorn Helgaas authored
      187f91db ("PCI/ASPM: Remove struct aspm_register_info.l1ss_cap")
      inadvertently removed a check for existence of the L1 PM Substates (L1SS)
      Capability before reading it.
      
      If there is no L1SS Capability, this means we mistakenly read PCI_COMMAND
      and PCI_STATUS (config address 0x04) and interpret that as the PCI_L1SS_CAP
      register, so we may incorrectly configure L1SS.
      
      Make sure the L1SS Capability exists before trying to read it.
      
      Fixes: 187f91db ("PCI/ASPM: Remove struct aspm_register_info.l1ss_cap")
      Link: https://lore.kernel.org/r/20221005025809.2247547-3-helgaas@kernel.orgSigned-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: default avatarKuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
      cfc00286
    • Bjorn Helgaas's avatar
      PCI/ASPM: Factor out L1 PM Substates configuration · 9e2a0317
      Bjorn Helgaas authored
      Move L1 PM Substates configuration from pcie_aspm_cap_init() to a new
      aspm_l1ss_init() function.  No functional change intended.
      
      Link: https://lore.kernel.org/r/20221005025809.2247547-2-helgaas@kernel.orgSigned-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: default avatarKuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
      9e2a0317
    • Vidya Sagar's avatar
      PCI/ASPM: Save L1 PM Substates Capability for suspend/resume · 4ff116d0
      Vidya Sagar authored
      Previously the L1 PM Substates Control Registers (CTL1 and CTL2) weren't
      saved and restored during suspend/resume leading to the L1 PM Substates
      configuration being lost post-resume.
      
      Save the L1 PM Substates Control Registers so that the configuration is
      retained post-resume.
      
      [bhelgaas: drop pci_is_pcie() testing; we can rely on pci_configure_ltr()
      having already done that]
      Link: https://lore.kernel.org/r/20220913131822.16557-3-vidyas@nvidia.comSigned-off-by: default avatarVidya Sagar <vidyas@nvidia.com>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      4ff116d0
    • Vidya Sagar's avatar
      PCI/ASPM: Refactor L1 PM Substates Control Register programming · 5e85eba6
      Vidya Sagar authored
      Refactor the code to extract the common code to program Control
      Registers 1 and 2 of the L1 PM Substates capability to a new function
      aspm_program_l1ss() and call it for both parent and child devices.
      
      [bhelgaas: squash in update to preserve fields we're not updating from
      https://lore.kernel.org/r/36fa13c5-e0f8-022f-77f7-7908e4df98b8@nvidia.com]
      Link: https://lore.kernel.org/r/20220913131822.16557-2-vidyas@nvidia.comSigned-off-by: default avatarVidya Sagar <vidyas@nvidia.com>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      5e85eba6
  2. 03 Oct, 2022 3 commits
  3. 29 Sep, 2022 1 commit
  4. 27 Sep, 2022 2 commits
  5. 21 Sep, 2022 6 commits
  6. 20 Sep, 2022 1 commit
  7. 16 Sep, 2022 1 commit
  8. 14 Sep, 2022 1 commit
  9. 12 Sep, 2022 7 commits