1. 05 Nov, 2021 4 commits
    • 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
  2. 04 Nov, 2021 1 commit
    • Selvin Xavier's avatar
      PCI: Do not enable AtomicOps on VFs · 5ec0a6fc
      Selvin Xavier authored
      Host crashes when pci_enable_atomic_ops_to_root() is called for VFs with
      virtual buses. The virtual buses added to SR-IOV have bus->self set to NULL
      and host crashes due to this.
      
        PID: 4481   TASK: ffff89c6941b0000  CPU: 53  COMMAND: "bash"
        ...
         #3 [ffff9a9481713808] oops_end at ffffffffb9025cd6
         #4 [ffff9a9481713828] page_fault_oops at ffffffffb906e417
         #5 [ffff9a9481713888] exc_page_fault at ffffffffb9a0ad14
         #6 [ffff9a94817138b0] asm_exc_page_fault at ffffffffb9c00ace
            [exception RIP: pcie_capability_read_dword+28]
            RIP: ffffffffb952fd5c  RSP: ffff9a9481713960  RFLAGS: 00010246
            RAX: 0000000000000001  RBX: ffff89c6b1096000  RCX: 0000000000000000
            RDX: ffff9a9481713990  RSI: 0000000000000024  RDI: 0000000000000000
            RBP: 0000000000000080   R8: 0000000000000008   R9: ffff89c64341a2f8
            R10: 0000000000000002  R11: 0000000000000000  R12: ffff89c648bab000
            R13: 0000000000000000  R14: 0000000000000000  R15: ffff89c648bab0c8
            ORIG_RAX: ffffffffffffffff  CS: 0010  SS: 0018
         #7 [ffff9a9481713988] pci_enable_atomic_ops_to_root at ffffffffb95359a6
         #8 [ffff9a94817139c0] bnxt_qplib_determine_atomics at ffffffffc08c1a33 [bnxt_re]
         #9 [ffff9a94817139d0] bnxt_re_dev_init at ffffffffc08ba2d1 [bnxt_re]
      
      Per PCIe r5.0, sec 9.3.5.10, the AtomicOp Requester Enable bit in Device
      Control 2 is reserved for VFs.  The PF value applies to all associated VFs.
      
      Return -EINVAL if pci_enable_atomic_ops_to_root() is called for a VF.
      
      Link: https://lore.kernel.org/r/1631354585-16597-1-git-send-email-selvin.xavier@broadcom.com
      Fixes: 35f5ace5 ("RDMA/bnxt_re: Enable global atomic ops if platform supports")
      Fixes: 430a2368 ("PCI: Add pci_enable_atomic_ops_to_root()")
      Signed-off-by: default avatarSelvin Xavier <selvin.xavier@broadcom.com>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: default avatarAndy Gospodarek <gospo@broadcom.com>
      5ec0a6fc
  3. 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
  4. 18 Oct, 2021 8 commits
  5. 15 Oct, 2021 2 commits
  6. 12 Oct, 2021 14 commits
  7. 28 Sep, 2021 4 commits
  8. 21 Sep, 2021 1 commit
  9. 20 Sep, 2021 2 commits
    • Linus Torvalds's avatar
      Linux 5.15-rc2 · e4e737bb
      Linus Torvalds authored
      e4e737bb
    • Linus Torvalds's avatar
      pci_iounmap'2: Electric Boogaloo: try to make sense of it all · 316e8d79
      Linus Torvalds authored
      Nathan Chancellor reports that the recent change to pci_iounmap in
      commit 9caea000 ("parisc: Declare pci_iounmap() parisc version only
      when CONFIG_PCI enabled") causes build errors on arm64.
      
      It took me about two hours to convince myself that I think I know what
      the logic of that mess of #ifdef's in the <asm-generic/io.h> header file
      really aim to do, and rewrite it to be easier to follow.
      
      Famous last words.
      
      Anyway, the code has now been lifted from that grotty header file into
      lib/pci_iomap.c, and has fairly extensive comments about what the logic
      is.  It also avoids indirecting through another confusing (and badly
      named) helper function that has other preprocessor config conditionals.
      
      Let's see what odd architecture did something else strange in this area
      to break things.  But my arm64 cross build is clean.
      
      Fixes: 9caea000 ("parisc: Declare pci_iounmap() parisc version only when CONFIG_PCI enabled")
      Reported-by: default avatarNathan Chancellor <nathan@kernel.org>
      Cc: Helge Deller <deller@gmx.de>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Guenter Roeck <linux@roeck-us.net>
      Cc: Ulrich Teichert <krypton@ulrich-teichert.org>
      Cc: James Bottomley <James.Bottomley@hansenpartnership.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      316e8d79
  10. 19 Sep, 2021 3 commits
    • Linus Torvalds's avatar
      Merge tag 'x86_urgent_for_v5.15_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 20621d2f
      Linus Torvalds authored
      Pull x86 fixes from Borislav Petkov:
      
       - Prevent a infinite loop in the MCE recovery on return to user space,
         which was caused by a second MCE queueing work for the same page and
         thereby creating a circular work list.
      
       - Make kern_addr_valid() handle existing PMD entries, which are marked
         not present in the higher level page table, correctly instead of
         blindly dereferencing them.
      
       - Pass a valid address to sanitize_phys(). This was caused by the
         mixture of inclusive and exclusive ranges. memtype_reserve() expect
         'end' being exclusive, but sanitize_phys() wants it inclusive. This
         worked so far, but with end being the end of the physical address
         space the fail is exposed.
      
       - Increase the maximum supported GPIO numbers for 64bit. Newer SoCs
         exceed the previous maximum.
      
      * tag 'x86_urgent_for_v5.15_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/mce: Avoid infinite loop for copy from user recovery
        x86/mm: Fix kern_addr_valid() to cope with existing but not present entries
        x86/platform: Increase maximum GPIO number for X86_64
        x86/pat: Pass valid address to sanitize_phys()
      20621d2f
    • Linus Torvalds's avatar
      Merge tag 'perf-urgent-2021-09-19' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · fec30362
      Linus Torvalds authored
      Pull perf event fix from Thomas Gleixner:
       "A single fix for the perf core where a value read with READ_ONCE() was
        checked and then reread which makes all the checks invalid. Reuse the
        already read value instead"
      
      * tag 'perf-urgent-2021-09-19' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        events: Reuse value read using READ_ONCE instead of re-reading it
      fec30362
    • Linus Torvalds's avatar
      Merge tag 'locking-urgent-2021-09-19' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · f5e29a26
      Linus Torvalds authored
      Pull locking fixes from Thomas Gleixner:
       "A set of updates for the RT specific reader/writer locking base code:
      
         - Make the fast path reader ordering guarantees correct.
      
         - Code reshuffling to make the fix simpler"
      
      [ This plays ugly games with atomic_add_return_release() because we
        don't have a plain atomic_add_release(), and should really be cleaned
        up, I think    - Linus ]
      
      * tag 'locking-urgent-2021-09-19' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        locking/rwbase: Take care of ordering guarantee for fastpath reader
        locking/rwbase: Extract __rwbase_write_trylock()
        locking/rwbase: Properly match set_and_save_state() to restore_state()
      f5e29a26