1. 05 Nov, 2021 16 commits
    • Bjorn Helgaas's avatar
      Merge branch 'remotes/lorenzo/pci/aardvark' · 27e76d06
      Bjorn Helgaas authored
      - Define macros for PCI_EXP_DEVCTL_PAYLOAD_* (Pali Rohár)
      
      - Set Max Payload Size to 512 bytes per Marvell spec (Pali Rohár)
      
      - Downgrade PIO Response Status messages to debug level (Marek Behún)
      
      - Preserve CRS SV (Config Request Retry Software Visibility) bit in
        emulated Root Control register (Pali Rohár)
      
      - Fix issue in configuring reference clock (Pali Rohár)
      
      - Don't clear status bits for masked interrupts (Pali Rohár)
      
      - Don't mask unused interrupts (Pali Rohár)
      
      - Avoid code repetition in advk_pcie_rd_conf() (Marek Behún)
      
      - Retry config accesses on CRS response (Pali Rohár)
      
      - Simplify emulated Root Capabilities initialization (Pali Rohár)
      
      - Fix several link training issues (Pali Rohár)
      
      - Fix link-up checking via LTSSM (Pali Rohár)
      
      - Fix reporting of Data Link Layer Link Active (Pali Rohár)
      
      - Fix emulation of W1C bits (Marek Behún)
      
      - Fix MSI domain .alloc() method to return zero on success (Marek Behún)
      
      - Read entire 16-bit MSI vector in MSI handler, not just low 8 bits (Marek
        Behún)
      
      - Clear Root Port I/O Space, Memory Space, and Bus Master Enable bits at
        startup; PCI core will set those as necessary (Pali Rohár)
      
      - When operating as a Root Port, set class code to "PCI Bridge" instead of
        the default "Mass Storage Controller" (Pali Rohár)
      
      - Add emulation for PCI_BRIDGE_CTL_BUS_RESET since aardvark doesn't
        implement this per spec (Pali Rohár)
      
      - Add emulation of option ROM BAR since aardvark doesn't implement this per
        spec (Pali Rohár)
      
      * remotes/lorenzo/pci/aardvark:
        PCI: aardvark: Fix support for PCI_ROM_ADDRESS1 on emulated bridge
        PCI: aardvark: Fix support for PCI_BRIDGE_CTL_BUS_RESET on emulated bridge
        PCI: aardvark: Set PCI Bridge Class Code to PCI Bridge
        PCI: aardvark: Fix support for bus mastering and PCI_COMMAND on emulated bridge
        PCI: aardvark: Read all 16-bits from PCIE_MSI_PAYLOAD_REG
        PCI: aardvark: Fix return value of MSI domain .alloc() method
        PCI: pci-bridge-emul: Fix emulation of W1C bits
        PCI: aardvark: Fix reporting Data Link Layer Link Active
        PCI: aardvark: Fix checking for link up via LTSSM state
        PCI: aardvark: Fix link training
        PCI: aardvark: Simplify initialization of rootcap on virtual bridge
        PCI: aardvark: Implement re-issuing config requests on CRS response
        PCI: aardvark: Deduplicate code in advk_pcie_rd_conf()
        PCI: aardvark: Do not unmask unused interrupts
        PCI: aardvark: Do not clear status bits of masked interrupts
        PCI: aardvark: Fix configuring Reference clock
        PCI: aardvark: Fix preserving PCI_EXP_RTCTL_CRSSVE flag on emulated bridge
        PCI: aardvark: Don't spam about PIO Response Status
        PCI: aardvark: Fix PCIe Max Payload Size setting
        PCI: Add PCI_EXP_DEVCTL_PAYLOAD_* macros
      27e76d06
    • Bjorn Helgaas's avatar
      Merge branch 'pci/misc' · 78be29ab
      Bjorn Helgaas authored
      - Tidy setup-irq.c comments (Pranay Sanghai)
      
      - Fix misspellings (Krzysztof Wilczyński)
      
      - Fix sprintf(), sscanf() format mismatches (Krzysztof Wilczyński)
      
      - Tidy cpqphp code formatting (Krzysztof Wilczyński)
      
      - Remove unused pci_pool wrappers, which have been replaced by dma_pool
        (Cai Huoqing)
      
      - Remove a redundant initialization in __pci_reset_function_locked() (Colin
        Ian King)
      
      - Use 'unsigned int' instead of 'unsigned' (Krzysztof Wilczyński)
      
      - Update PCI subsystem information in MAINTAINERS (Krzysztof Wilczyński)
      
      - Include generic <linux/> headers instead of <asm/> for cpqphp and vmd
        (Krzysztof Wilczyński)
      
      * pci/misc:
        PCI: vmd: Drop redundant includes of <asm/device.h>, <asm/msi.h>
        PCI: cpqphp: Use <linux/io.h> instead of <asm/io.h>
        MAINTAINERS: Update PCI subsystem information
        PCI: Prefer 'unsigned int' over bare 'unsigned'
        PCI: Remove redundant 'rc' initialization
        PCI: Remove unused pci_pool wrappers
        PCI: cpqphp: Format if-statement code block correctly
        PCI: Use unsigned to match sscanf("%x") in pci_dev_str_match_path()
        PCI: hv: Remove unnecessary use of %hx
        PCI: Correct misspelled and remove duplicated words
        PCI: Tidy comments
      78be29ab
    • Bjorn Helgaas's avatar
      Merge branch 'pci/vpd' · 10d0f97f
      Bjorn Helgaas authored
      - Add pci_read_vpd_any(), pci_write_vpd_any() to access VPD at arbitrary
        offsets (Heiner Kallweit)
      
      - Use VPD API to replace custom code in cxgb3 driver (Heiner Kallweit)
      
      * pci/vpd:
        cxgb3: Remove seeprom_write and use VPD API
        cxgb3: Use VPD API in t3_seeprom_wp()
        cxgb3: Remove t3_seeprom_read and use VPD API
        PCI/VPD: Use pci_read_vpd_any() in pci_vpd_size()
        PCI/VPD: Add pci_read/write_vpd_any()
      10d0f97f
    • Bjorn Helgaas's avatar
      Merge branch 'pci/virtualization' · 7aae9412
      Bjorn Helgaas authored
      - Avoid bus resets on Atheros QCA6174, since they hang (Ingmar Klein)
      
      - Use store and forward mode on Pericom PI7C9X2G switches to avoid ACS
        erratum with ACS P2P Request Redirect (Nathan Rossi)
      
      * pci/virtualization:
        PCI: Add ACS quirk for Pericom PI7C9X2G switches
        PCI: Mark Atheros QCA6174 to avoid bus reset
      7aae9412
    • Bjorn Helgaas's avatar
      Merge branch 'pci/sysfs' · ebf275b8
      Bjorn Helgaas authored
      - Check for CAP_SYS_ADMIN before validating sysfs user input, not after
        (Krzysztof Wilczyński)
      
      - Always return -EINVAL from sysfs "store" functions for invalid user input
        instead of -EINVAL sometimes and -ERANGE others (Krzysztof Wilczyński)
      
      - Use kstrtobool() directly instead of the strtobool() wrapper (Krzysztof
        Wilczyński)
      
      * pci/sysfs:
        PCI: Use kstrtobool() directly, sans strtobool() wrapper
        PCI/sysfs: Return -EINVAL consistently from "store" functions
        PCI/sysfs: Check CAP_SYS_ADMIN before parsing user input
      
      # Conflicts:
      #	drivers/pci/iov.c
      ebf275b8
    • Bjorn Helgaas's avatar
      Merge branch 'pci/switchtec' · e34f4262
      Bjorn Helgaas authored
      - Return error to application when command execution fails because an
        out-of-band reset has cleared the device BARs, Memory Space Enable, etc
        (Kelvin Cao)
      
      - Fix MRPC error status handling issue (Kelvin Cao)
      
      - Mask out other bits when reading of management VEP instance ID (Kelvin
        Cao)
      
      - Return EOPNOTSUPP instead of ENOTSUPP from sysfs show functions (Kelvin
        Cao)
      
      - Add check of event support (Logan Gunthorpe)
      
      * pci/switchtec:
        PCI/switchtec: Add check of event support
        PCI/switchtec: Replace ENOTSUPP with EOPNOTSUPP
        PCI/switchtec: Update the way of getting management VEP instance ID
        PCI/switchtec: Fix a MRPC error status handling issue
        PCI/switchtec: Error out MRPC execution when MMIO reads fail
      e34f4262
    • Bjorn Helgaas's avatar
      Merge branch 'pci/resource' · 1ebec13f
      Bjorn Helgaas authored
      - Coalesce host bridge contiguous apertures to allow P2P bridge windows
        that span several contiguous host bridge apertures (Kai-Heng Feng)
      
      * pci/resource:
        PCI: Coalesce host bridge contiguous apertures
      1ebec13f
    • Bjorn Helgaas's avatar
      Merge branch 'pci/portdrv' · 357cf0cd
      Bjorn Helgaas authored
      - Don't setup portdrv IRQs if there are no port drivers that use them, to
        conserve vectors and avoid spurious events (Jan Kiszka)
      
      * pci/portdrv:
        PCI/portdrv: Do not setup up IRQs if there are no users
      357cf0cd
    • Bjorn Helgaas's avatar
      Merge branch 'pci/p2pdma' · 1f948b88
      Bjorn Helgaas authored
      - Apply bus offset correctly in DMA address calculation, which used the
        wrong sign before (Wang Lu)
      
      * pci/p2pdma:
        PCI/P2PDMA: Apply bus offset correctly in DMA address calculation
      1f948b88
    • Bjorn Helgaas's avatar
      Merge branch 'pci/msi' · efe68563
      Bjorn Helgaas authored
      - Document sysfs "irq" attribute, which contains either the INTx IRQ (the
        intended behavior) or the first MSI IRQ (historical mistake retained for
        backwards compatibility) (Barry Song)
      
      - Rework "irq" sysfs show function to explicitly fetch first MSI IRQ
        instead of depending on core to put it in dev->irq, to enable future core
        cleanup (Barry Song)
      
      * pci/msi:
        PCI/sysfs: Explicitly show first MSI IRQ for 'irq'
        PCI: Document /sys/bus/pci/devices/.../irq
      efe68563
    • Bjorn Helgaas's avatar
      Merge branch 'pci/hotplug' · 4917f718
      Bjorn Helgaas authored
      - Ignore Link Down/Up caused by error-induced Hot Reset so endpoint driver
        can remain bound to device during error recovery (Lukas Wunner)
      
      - Remove unused resume err_handler (Lukas Wunner)
      
      - Remove unused pcie_port_bus_{,un}register() declarations (Lukas Wunner)
      
      - Skip compiling err.c when CONFIG_PCIEAER not set (Lukas Wunner)
      
      * pci/hotplug:
        PCI/ERR: Reduce compile time for CONFIG_PCIEAER=n
        PCI/portdrv: Remove unused pcie_port_bus_{,un}register() declarations
        PCI/portdrv: Remove unused resume err_handler
        PCI: pciehp: Ignore Link Down/Up caused by error-induced Hot Reset
        PCI/portdrv: Rename pm_iter() to pcie_port_device_iter()
      4917f718
    • Bjorn Helgaas's avatar
      Merge branch 'pci/driver' · d03c426f
      Bjorn Helgaas authored
      - Drop the struct pci_dev.driver pointer, which is redundant with the
        struct device.driver pointer (Uwe Kleine-König)
      
      * pci/driver:
        PCI: Remove struct pci_dev->driver
        PCI: Use to_pci_driver() instead of pci_dev->driver
        x86/pci/probe_roms: Use to_pci_driver() instead of pci_dev->driver
        perf/x86/intel/uncore: Use to_pci_driver() instead of pci_dev->driver
        powerpc/eeh: Use to_pci_driver() instead of pci_dev->driver
        usb: xhci: Use to_pci_driver() instead of pci_dev->driver
        cxl: Use to_pci_driver() instead of pci_dev->driver
        cxl: Factor out common dev->driver expressions
        xen/pcifront: Use to_pci_driver() instead of pci_dev->driver
        xen/pcifront: Drop pcifront_common_process() tests of pcidev, pdrv
        nfp: use dev_driver_string() instead of pci_dev->driver->name
        mlxsw: pci: Use dev_driver_string() instead of pci_dev->driver->name
        net: marvell: prestera: use dev_driver_string() instead of pci_dev->driver->name
        net: hns3: use dev_driver_string() instead of pci_dev->driver->name
        crypto: hisilicon - use dev_driver_string() instead of pci_dev->driver->name
        powerpc/eeh: Use dev_driver_string() instead of struct pci_dev->driver->name
        ssb: Use dev_driver_string() instead of pci_dev->driver->name
        bcma: simplify reference to driver name
        crypto: qat - simplify adf_enable_aer()
        scsi: message: fusion: Remove unused mpt_pci driver .probe() 'id' parameter
        PCI/ERR: Factor out common dev->driver expressions
        PCI: Drop pci_device_probe() test of !pci_dev->driver
        PCI: Drop pci_device_remove() test of pci_dev->driver
        PCI: Return NULL for to_pci_driver(NULL)
      d03c426f
    • Bjorn Helgaas's avatar
      Merge branch 'pci/enumeration' · 1cac57a2
      Bjorn Helgaas authored
      - Rename pcibios_add_device() to pcibios_device_add() since it's called
        from pci_device_add() (Oliver O'Halloran)
      
      - Don't try to enable AtomicOps on VFs, since they can only be enabled on
        the PF (Selvin Xavier)
      
      * pci/enumeration:
        PCI: Do not enable AtomicOps on VFs
        PCI: Rename pcibios_add_device() to pcibios_device_add()
      1cac57a2
    • Bjorn Helgaas's avatar
      Merge branch 'pci/aspm' · 5e19196c
      Bjorn Helgaas authored
      - Re-enable LTR in Downstream Ports after it has been disabled by reset or
        hotplug to allow use of ASPM L1.2 again and prevent Unsupported Request
        errors when Endpoint sends LTR messages (Mingchuang Qiao)
      
      * pci/aspm:
        PCI: Re-enable Downstream Port LTR after reset or hotplug
      5e19196c
    • Bjorn Helgaas's avatar
      Merge branch 'pci/acpi' · 8d55770b
      Bjorn Helgaas authored
      - Simplify _OSC negotiation with platform for control of PCIe features
        (Joerg Roedel)
      
      * pci/acpi:
        PCI/ACPI: Check for _OSC support in acpi_pci_osc_control_set()
        PCI/ACPI: Move _OSC query checks to separate function
        PCI/ACPI: Move supported and control calculations to separate functions
        PCI/ACPI: Remove OSC_PCI_SUPPORT_MASKS and OSC_PCI_CONTROL_MASKS
      8d55770b
    • Nathan Rossi's avatar
      PCI: Add ACS quirk for Pericom PI7C9X2G switches · acd61ffb
      Nathan Rossi authored
      The Pericom PI7C9X2G404/PI7C9X2G304/PI7C9X2G303 PCIe switches have an
      erratum for ACS P2P Request Redirect behaviour when used in the cut-through
      forwarding mode. The recommended work around for this issue is to use the
      switch in store and forward mode. The erratum results in packets being
      queued and not being delivered upstream, which can be observed as very poor
      downstream device performance and/or dropped device-generated
      data/interrupts.
      
      Add a fixup so that when enabling or resuming the downstream port we check
      if it has enabled ACS P2P Request Redirect, and if so, change the device
      (via the upstream port) to use the store and forward operating mode.
      
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=177471
      Link: https://lore.kernel.org/r/20210910025823.196508-1-nathan@nathanrossi.comTested-by: default avatarAlex Williamson <alex.williamson@redhat.com>
      Signed-off-by: default avatarNathan Rossi <nathan.rossi@digi.com>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      acd61ffb
  2. 04 Nov, 2021 2 commits
  3. 02 Nov, 2021 1 commit
  4. 29 Oct, 2021 7 commits
  5. 27 Oct, 2021 2 commits
  6. 26 Oct, 2021 5 commits
  7. 19 Oct, 2021 1 commit
    • Mingchuang Qiao's avatar
      PCI: Re-enable Downstream Port LTR after reset or hotplug · e1b0d0bb
      Mingchuang Qiao authored
      Per PCIe r5.0, sec 7.5.3.16, Downstream Ports must disable LTR if the link
      goes down (the Port goes DL_Down status).  This is a problem because the
      Downstream Port's dev->ltr_path is still set, so we think LTR is still
      enabled, and we enable LTR in the Endpoint.  When it sends LTR messages,
      they cause Unsupported Request errors at the Downstream Port.
      
      This happens in the reset path, where we may enable LTR in
      pci_restore_pcie_state() even though the Downstream Port disabled LTR
      because the reset caused a link down event.
      
      It also happens in the hot-remove and hot-add path, where we may enable LTR
      in pci_configure_ltr() even though the Downstream Port disabled LTR when
      the hot-remove took the link down.
      
      In these two scenarios, check the upstream bridge and restore its LTR
      enable if appropriate.
      
      The Unsupported Request may be logged by AER as follows:
      
        pcieport 0000:00:1d.0: AER: Uncorrected (Non-Fatal) error received: id=00e8
        pcieport 0000:00:1d.0: PCIe Bus Error: severity=Uncorrected (Non-Fatal), type=Transaction Layer, id=00e8(Requester ID)
        pcieport 0000:00:1d.0:   device [8086:9d18] error status/mask=00100000/00010000
        pcieport 0000:00:1d.0:    [20] Unsupported Request    (First)
      
      In addition, if LTR is not configured correctly, the link cannot enter the
      L1.2 state, which prevents some machines from entering the S0ix low power
      state.
      
      [bhelgaas: commit log]
      Link: https://lore.kernel.org/r/20211012075614.54576-1-mingchuang.qiao@mediatek.comReported-by: default avatarUtkarsh H Patel <utkarsh.h.patel@intel.com>
      Signed-off-by: default avatarMingchuang Qiao <mingchuang.qiao@mediatek.com>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
      e1b0d0bb
  8. 18 Oct, 2021 6 commits