1. 21 Oct, 2020 10 commits
    • Bjorn Helgaas's avatar
      Merge branch 'remotes/lorenzo/pci/aardvark' · d1640a83
      Bjorn Helgaas authored
      - Fix s390 build error (Pali Rohár)
      
      - Check for errors from pci_bridge_emul_init() (Pali Rohár)
      
      - Export pci-bridge-emul functions for use by modules (Pali Rohár)
      
      - Make aardvark driver modular (Pali Rohár)
      
      - Move PCIe reset code to advk_pcie_train_link() (Pali Rohár)
      
      - Convert internal SMCC firmware return codes to errno (Pali Rohár)
      
      - Fix initialization with old Marvell's Arm Trusted Firmware (Pali Rohár)
      
      * remotes/lorenzo/pci/aardvark:
        PCI: aardvark: Fix initialization with old Marvell's Arm Trusted Firmware
        phy: marvell: comphy: Convert internal SMCC firmware return codes to errno
        PCI: aardvark: Move PCIe reset card code to advk_pcie_train_link()
        PCI: aardvark: Implement driver 'remove' function and allow to build it as module
        PCI: pci-bridge-emul: Export API functions
        PCI: aardvark: Check for errors from pci_bridge_emul_init() call
        PCI: aardvark: Fix compilation on s390
      d1640a83
    • Bjorn Helgaas's avatar
      Merge branch 'remotes/lorenzo/pci/arm' · 5bedfdb2
      Bjorn Helgaas authored
      - Remove unused msi_ctrl, io_optional and align_resource fields from ARM
        struct hw_pci (Lorenzo Pieralisi)
      
      * remotes/lorenzo/pci/arm:
        ARM/PCI: Remove unused fields from struct hw_pci
      5bedfdb2
    • Bjorn Helgaas's avatar
      Merge branch 'remotes/lorenzo/pci/pci-iomap' · 299af12a
      Bjorn Helgaas authored
      - Remove useless __KERNEL__ preprocessor guard in sparc io_32.h (Lorenzo
        Pieralisi)
      
      - Move ioremap/iounmap declaration so it's visible in asm-generic/io.h
        (Lorenzo Pieralisi)
      
      - Fix memory leak in generic !CONFIG_GENERIC_IOMAP pci_iounmap()
        implementation (Lorenzo Pieralisi)
      
      * remotes/lorenzo/pci/pci-iomap:
        asm-generic/io.h: Fix !CONFIG_GENERIC_IOMAP pci_iounmap() implementation
        sparc32: Move ioremap/iounmap declaration before asm-generic/io.h include
        sparc32: Remove useless io_32.h __KERNEL__ preprocessor guard
      299af12a
    • Bjorn Helgaas's avatar
      Merge branch 'remotes/lorenzo/pci/apei' · 03b482e2
      Bjorn Helgaas authored
      - Add ACPI APEI notifier chain for unknown (vendor) CPER records (Shiju
        Jose)
      
      - Add handling of HiSilicon HIP PCIe controller errors (Yicong Yang)
      
      * remotes/lorenzo/pci/apei:
        PCI: hip: Add handling of HiSilicon HIP PCIe controller errors
        ACPI / APEI: Add a notifier chain for unknown (vendor) CPER records
      03b482e2
    • Bjorn Helgaas's avatar
      Merge branch 'pci/misc' · 8b28a3f3
      Bjorn Helgaas authored
      - Remove unnecessary #includes (Gustavo Pimentel)
      
      - Fix intel_mid_pci.c build error when !CONFIG_ACPI (Randy Dunlap)
      
      - Use scnprintf(), not snprintf(), in sysfs "show" functions (Krzysztof
        Wilczyński)
      
      - Simplify pci-pf-stub by using module_pci_driver() (Liu Shixin)
      
      - Print IRQ used by Link Bandwidth Notification (Dongdong Liu)
      
      - Update sysfs mmap-related #ifdef comments (Clint Sbisa)
      
      - Simplify pci_dev_reset_slot_function() (Lukas Wunner)
      
      - Use "NULL" instead of "0" to fix sparse warnings (Gustavo Pimentel)
      
      - Simplify bool comparisons (Krzysztof Wilczyński)
      
      - Drop double zeroing for P2PDMA sg_init_table() (Julia Lawall)
      
      * pci/misc:
        PCI: v3-semi: Remove unneeded break
        PCI/P2PDMA: Drop double zeroing for sg_init_table()
        PCI: Simplify bool comparisons
        PCI: endpoint: Use "NULL" instead of "0" as a NULL pointer
        PCI: Simplify pci_dev_reset_slot_function()
        PCI: Update mmap-related #ifdef comments
        PCI/LINK: Print IRQ number used by port
        PCI/IOV: Simplify pci-pf-stub with module_pci_driver()
        PCI: Use scnprintf(), not snprintf(), in sysfs "show" functions
        x86/PCI: Fix intel_mid_pci.c build error when ACPI is not enabled
        PCI: Remove unnecessary header includes
      8b28a3f3
    • Bjorn Helgaas's avatar
      Merge branch 'pci/pm' · 0d2493ab
      Bjorn Helgaas authored
      - Remove unused pcibios_pm_ops (Vaibhav Gupta)
      
      - Rename pci_dev.d3_delay to d3hot_delay (Krzysztof Wilczyński)
      
      - Apply D2 transition delay as microseconds, not milliseconds (Bjorn
        Helgaas)
      
      * pci/pm:
        PCI/PM: Revert "PCI/PM: Apply D2 delay as milliseconds, not microseconds"
        PCI/PM: Remove unused PCI_PM_BUS_WAIT
        PCI/PM: Rename pci_dev.d3_delay to d3hot_delay
        PCI/PM: Remove unused pcibios_pm_ops
      0d2493ab
    • Bjorn Helgaas's avatar
      Merge branch 'pci/hotplug' · 5cfdc750
      Bjorn Helgaas authored
      - Use for_each_child_of_node() and for_each_node_by_name() instead of
        open-coding them (Qinglang Miao)
      
      - Reduce pciehp noisiness on hot removal (Lukas Wunner)
      
      - Remove unused assignment in shpchp (Krzysztof Wilczyński)
      
      * pci/hotplug:
        PCI: shpchp: Remove unused 'rc' assignment
        PCI: pciehp: Reduce noisiness on hot removal
        PCI: rpadlpar: Use for_each_child_of_node() and for_each_node_by_name()
      5cfdc750
    • Bjorn Helgaas's avatar
      Merge branch 'pci/enumeration' · 28a18aec
      Bjorn Helgaas authored
      - Tone down message about missing optional MCFG (Jeremy Linton)
      
      - Add schedule point in pci_read_config() (Jiang Biao)
      
      - Add Ampere Altra SOC MCFG quirk (Tuan Phan)
      
      - Add Kconfig options for MPS/MRRS strategy (Jim Quinlan)
      
      * pci/enumeration:
        PCI: Add Kconfig options for MPS/MRRS strategy
        PCI/ACPI: Add Ampere Altra SOC MCFG quirk
        PCI: Add schedule point in pci_read_config()
        PCI/ACPI: Tone down missing MCFG message
      28a18aec
    • Bjorn Helgaas's avatar
      Merge branch 'pci/aspm' · a9f37906
      Bjorn Helgaas authored
      - Remove struct aspm_register_info (Saheed O. Bolarinwa)
      
      - Remove struct pcie_link_state.l1ss (Saheed O. Bolarinwa)
      
      * pci/aspm:
        PCI/ASPM: Remove struct pcie_link_state.l1ss
        PCI/ASPM: Remove struct aspm_register_info.l1ss_cap
        PCI/ASPM: Pass L1SS Capabilities value, not struct aspm_register_info
        PCI/ASPM: Remove struct aspm_register_info.l1ss_ctl1
        PCI/ASPM: Remove struct aspm_register_info.l1ss_ctl2 (unused)
        PCI/ASPM: Remove struct aspm_register_info.l1ss_cap_ptr
        PCI/ASPM: Remove struct aspm_register_info.latency_encoding
        PCI/ASPM: Remove struct aspm_register_info.enabled
        PCI/ASPM: Remove struct aspm_register_info.support
        PCI/ASPM: Use 'parent' and 'child' for readability
        PCI/ASPM: Move LTR path check to where it's used
        PCI/ASPM: Move pci_clear_and_set_dword() earlier
      a9f37906
    • Bjorn Helgaas's avatar
      Merge branch 'pci/acs' · 97d0260b
      Bjorn Helgaas authored
      - Enable Translation Blocking for external devices (Rajat Jain)
      
      * pci/acs:
        PCI/ACS: Enable Translation Blocking for external devices
      97d0260b
  2. 20 Oct, 2020 1 commit
  3. 16 Oct, 2020 12 commits
  4. 05 Oct, 2020 3 commits
  5. 02 Oct, 2020 2 commits
  6. 30 Sep, 2020 5 commits
  7. 29 Sep, 2020 2 commits
  8. 28 Sep, 2020 1 commit
  9. 18 Sep, 2020 1 commit
  10. 17 Sep, 2020 3 commits
    • Gustavo Pimentel's avatar
      PCI: endpoint: Use "NULL" instead of "0" as a NULL pointer · 32b313ce
      Gustavo Pimentel authored
      When returning a NULL pointer, use "NULL" instead of "0".
      
      Fixes sparse warning given by executing "make C=2 drivers/pci/":
      
        CHECK   drivers/pci/endpoint/pci-epc-core.c
         drivers/pci/endpoint/pci-epc-core.c: note: in included file:
         ./include/linux/pci-ep-cfs.h:22:16: warning:
         Using plain integer as NULL pointer
        CHECK   drivers/pci/endpoint/pci-epf-core.c
         drivers/pci/endpoint/pci-epf-core.c: note: in included file:
         ./include/linux/pci-ep-cfs.h:31:16: warning:
         Using plain integer as NULL pointer
      
      Link: https://lore.kernel.org/r/80895f7465719edb3aa259e907acc4bc3217945c.1600378209.git.gustavo.pimentel@synopsys.comReported-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Signed-off-by: default avatarGustavo Pimentel <gustavo.pimentel@synopsys.com>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Cc: Kishon Vijay Abraham I <kishon@ti.com>
      Cc: Joao Pinto <jpinto@synopsys.com>
      32b313ce
    • Lukas Wunner's avatar
      PCI: Simplify pci_dev_reset_slot_function() · 10791141
      Lukas Wunner authored
      pci_dev_reset_slot_function() refuses to reset a hotplug slot if it is
      shared by multiple pci_devs.  That's the case if and only if the slot is
      occupied by a multifunction device.
      
      Simplify the function to check the device's multifunction flag instead
      of iterating over the devices on the bus.  (Iterating over the devices
      requires holding pci_bus_sem, which the function erroneously does not
      acquire.)
      
      Link: https://lore.kernel.org/r/c6aab5af096f7b1b3db57f6335cebba8f0fcca89.1595330431.git.lukas@wunner.deSigned-off-by: default avatarLukas Wunner <lukas@wunner.de>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Cc: Alex Williamson <alex.williamson@redhat.com>
      10791141
    • Lukas Wunner's avatar
      PCI: pciehp: Reduce noisiness on hot removal · 8a614499
      Lukas Wunner authored
      When a PCIe card is hot-removed, the Presence Detect State and Data Link
      Layer Link Active bits often do not clear simultaneously.  I've seen delays
      of up to 244 msec between the two events with Thunderbolt.
      
      After pciehp has brought down the slot in response to the first event, the
      other bit may still be set.  It's not discernible whether it's set because
      a new card is already in the slot or if it will soon clear.  So pciehp
      tries to bring up the slot and in the latter case fails with a bunch of
      messages, some of them at KERN_ERR severity.  If the slot is no longer
      occupied, the messages are false positives and annoy users.
      
      Stuart Hayes reports the following splat on hot removal:
      
        KERN_INFO pcieport 0000:3c:06.0: pciehp: Slot(180): Link Up
        KERN_INFO pcieport 0000:3c:06.0: pciehp: Timeout waiting for Presence Detect
        KERN_ERR  pcieport 0000:3c:06.0: pciehp: link training error: status 0x0001
        KERN_ERR  pcieport 0000:3c:06.0: pciehp: Failed to check link status
      
      Dongdong Liu complains about a similar splat:
      
        KERN_INFO pciehp 0000:80:10.0:pcie004: Slot(36): Link Down
        KERN_INFO iommu: Removing device 0000:87:00.0 from group 12
        KERN_INFO pciehp 0000:80:10.0:pcie004: Slot(36): Card present
        KERN_INFO pcieport 0000:80:10.0: Data Link Layer Link Active not set in 1000 msec
        KERN_ERR  pciehp 0000:80:10.0:pcie004: Failed to check link status
      
      Users are particularly irritated to see a bringup attempt even though the
      slot was explicitly brought down via sysfs.  In a perfect world, we could
      avoid this by setting Link Disable on slot bringdown and re-enabling it
      upon a Presence Detect State change.  In reality however, there are broken
      hotplug ports which hardwire Presence Detect to zero, see 80696f99
      ("PCI: pciehp: Tolerate Presence Detect hardwired to zero").  Conversely,
      PCIe r1.0 hotplug ports hardwire Link Active to zero because Link Active
      Reporting wasn't specified before PCIe r1.1.  On unplug, some ports first
      clear Presence then Link (see Stuart Hayes' splat) whereas others use the
      inverse order (see Dongdong Liu's splat).  To top it off, there are hotplug
      ports which flap the Presence and Link bits on slot bringup, see
      6c35a1ac ("PCI: pciehp: Tolerate initially unstable link").
      
      pciehp is designed to work with all of these variants.  Surplus attempts at
      slot bringup are a lesser evil than not being able to bring up slots at
      all.  Although we could try to perfect the behavior for specific hotplug
      controllers, we'd risk breaking others or increasing code complexity.
      
      But we can certainly minimize annoyance by emitting only a single message
      with KERN_INFO severity if bringup is unsuccessful:
      
      * Drop the "Timeout waiting for Presence Detect" message in
        pcie_wait_for_presence().  The sole caller of that function,
        pciehp_check_link_status(), ignores the timeout and carries on.  It emits
        error messages of its own and I don't think this particular message adds
        much value.
      
      * There's a single error condition in pciehp_check_link_status() which
        does not emit a message.  Adding one allows dropping the "Failed to check
        link status" message emitted by board_added() if
        pciehp_check_link_status() returns a non-zero integer.
      
      * Tone down all messages in pciehp_check_link_status() to KERN_INFO
        severity and rephrase them to look as innocuous as possible.  To this
        end, move the message emitted by pcie_wait_for_link_delay() to its
        callers.
      
      As a result, Stuart Hayes' splat becomes:
      
        KERN_INFO pcieport 0000:3c:06.0: pciehp: Slot(180): Link Up
        KERN_INFO pcieport 0000:3c:06.0: pciehp: Slot(180): Cannot train link: status 0x0001
      
      Dongdong Liu's splat becomes:
      
        KERN_INFO pciehp 0000:80:10.0:pcie004: Slot(36): Card present
        KERN_INFO pciehp 0000:80:10.0:pcie004: Slot(36): No link
      
      The messages now merely serve as information that presence or link bits
      were set a little longer than expected.  Bringup failures which are not
      false positives are still reported, albeit no longer at KERN_ERR severity.
      
      Link: https://lore.kernel.org/linux-pci/20200310182100.102987-1-stuart.w.hayes@gmail.com/
      Link: https://lore.kernel.org/linux-pci/1547649064-19019-1-git-send-email-liudongdong3@huawei.com/
      Link: https://lore.kernel.org/r/b45e46fd8a6aa6930aaac9d7718c2e4b787a4e5e.1595935071.git.lukas@wunner.deReported-by: default avatarStuart Hayes <stuart.w.hayes@gmail.com>
      Reported-by: default avatarDongdong Liu <liudongdong3@huawei.com>
      Signed-off-by: default avatarLukas Wunner <lukas@wunner.de>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
      8a614499