1. 20 Apr, 2023 10 commits
    • Bjorn Helgaas's avatar
      Merge branch 'pci/controller/ixp4xx' · 73af737e
      Bjorn Helgaas authored
      - Use the PCI_CONF1_ADDRESS() macro to simplify config space address
        computation (Pali Rohár)
      
      * pci/controller/ixp4xx:
        PCI: ixp4xx: Use PCI_CONF1_ADDRESS() macro
      73af737e
    • Bjorn Helgaas's avatar
      Merge branch 'pci/controller/dwc' · 0c78d418
      Bjorn Helgaas authored
      - Install i.MX6 PCI abort handler only when DT contains a PCI controller
        claimed by the imx6 driver (H. Nikolaus Schaller)
      
      * pci/controller/dwc:
        PCI: imx6: Install the fault handler only on compatible match
      0c78d418
    • Bjorn Helgaas's avatar
      Merge branch 'pci/controller/dt' · 580b8bce
      Bjorn Helgaas authored
      - Convert Amlogic Meson AXG DWC PCIe SoC controller bindings to dt-schema
        (Neil Armstrong)
      
      - Restructure i.MX schema to extract common properties to be shared by Root
        Complex and Endpoint schema (Richard Zhu)
      
      * pci/controller/dt:
        dt-bindings: imx6q-pcie: Restruct i.MX PCIe schema
        dt-bindings: PCI: convert amlogic,meson-pcie.txt to dt-schema
      580b8bce
    • Bjorn Helgaas's avatar
      Merge branch 'pci/resource' · 1c03b5bf
      Bjorn Helgaas authored
      - Add pci_dev_for_each_resource() and pci_bus_for_each_resource() iterators
        to simplify loops (Andy Shevchenko)
      
      * pci/resource:
        EISA: Drop unused pci_bus_for_each_resource() index argument
        PCI: Make pci_bus_for_each_resource() index optional
        PCI: Document pci_bus_for_each_resource()
        PCI: Introduce pci_dev_for_each_resource()
        PCI: Introduce pci_resource_n()
      1c03b5bf
    • Bjorn Helgaas's avatar
      Merge branch 'pci/reset' · 43ca31e0
      Bjorn Helgaas authored
      - Wait longer for devices to become ready after resume (as we do for reset)
        to accommodate Intel Titan Ridge xHCI devices (Mika Westerberg)
      
      - Drop pci_bridge_wait_for_secondary_bus() timeout parameter since all
        callers pass the same value (Mika Westerberg)
      
      - Extend D3hot delay for NVIDIA HDA controllers to avoid unrecoverable
        devices after a bus reset (Alex Williamson)
      
      * pci/reset:
        PCI/PM: Extend D3hot delay for NVIDIA HDA controllers
        PCI/PM: Drop pci_bridge_wait_for_secondary_bus() timeout parameter
        PCI/PM: Increase wait time after resume
      43ca31e0
    • Bjorn Helgaas's avatar
      Merge branch 'pci/p2pdma' · cc8a983d
      Bjorn Helgaas authored
      - Fix pci_p2pmem_find_many() kernel-doc (Cai Huoqing)
      
      * pci/p2pdma:
        PCI/P2PDMA: Fix pci_p2pmem_find_many() kernel-doc
      cc8a983d
    • Bjorn Helgaas's avatar
      Merge branch 'pci/hotplug' · 8745c3d5
      Bjorn Helgaas authored
      - Fix pciehp AB-BA deadlock between reset_lock and device_lock (Lukas
        Wunner)
      
      * pci/hotplug:
        PCI: pciehp: Fix AB-BA deadlock between reset_lock and device_lock
      8745c3d5
    • Bjorn Helgaas's avatar
      Merge branch 'pci/enumeration' · 66d3d0d0
      Bjorn Helgaas authored
      - Use of_property_present(), instead of lower-level functions like
        of_get_property(), for testing DT property presence (Rob Herring)
      
      * pci/enumeration:
        PCI: Use of_property_present() for testing DT property presence
      66d3d0d0
    • Bjorn Helgaas's avatar
      Merge branch 'pci/aspm' · 90d66d4d
      Bjorn Helgaas authored
      - Work around Chromebook firmware issue that corrupts Extended Capability
        list (including L1 PM Substates capability) on D3cold -> D0 transitions
        (Ron Lee)
      
      * pci/aspm:
        PCI: Fix up L1SS capability for Intel Apollo Lake Root Port
      90d66d4d
    • Bjorn Helgaas's avatar
      Merge branch 'pci/aer' · 1a65a327
      Bjorn Helgaas authored
      - Remove unnecessary <linux/aer.h> includes (Bjorn Helgaas)
      
      - Clear Device Status after EDR error recovery.  Firmware collects EDR
        error information, but the OS is responsible for clearing it (Kuppuswamy
        Sathyanarayanan)
      
      * pci/aer:
        PCI/EDR: Add edr_handle_event() comments
        PCI/EDR: Clear Device Status after EDR error recovery
        efi/cper: Remove unnecessary aer.h include
      1a65a327
  2. 18 Apr, 2023 1 commit
  3. 17 Apr, 2023 1 commit
    • Alex Williamson's avatar
      PCI/PM: Extend D3hot delay for NVIDIA HDA controllers · a5a6dd26
      Alex Williamson authored
      Assignment of NVIDIA Ampere-based GPUs have seen a regression since the
      below referenced commit, where the reduced D3hot transition delay appears
      to introduce a small window where a D3hot->D0 transition followed by a bus
      reset can wedge the device.  The entire device is subsequently unavailable,
      returning -1 on config space read and is unrecoverable without a host
      reset.
      
      This has been observed with RTX A2000 and A5000 GPU and audio functions
      assigned to a Windows VM, where shutdown of the VM places the devices in
      D3hot prior to vfio-pci performing a bus reset when userspace releases the
      devices.  The issue has roughly a 2-3% chance of occurring per shutdown.
      
      Restoring the HDA controller d3hot_delay to the effective value before the
      below commit has been shown to resolve the issue.  NVIDIA confirms this
      change should be safe for all of their HDA controllers.
      
      Fixes: 3e347969 ("PCI/PM: Reduce D3hot delay with usleep_range()")
      Link: https://lore.kernel.org/r/20230413194042.605768-1-alex.williamson@redhat.comReported-by: default avatarZhiyi Guo <zhguo@redhat.com>
      Signed-off-by: default avatarAlex Williamson <alex.williamson@redhat.com>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: default avatarTarun Gupta <targupta@nvidia.com>
      Cc: Abhishek Sahu <abhsahu@nvidia.com>
      Cc: Tarun Gupta <targupta@nvidia.com>
      a5a6dd26
  4. 11 Apr, 2023 4 commits
  5. 07 Apr, 2023 4 commits
  6. 06 Apr, 2023 1 commit
  7. 05 Apr, 2023 2 commits
  8. 04 Apr, 2023 3 commits
  9. 24 Mar, 2023 2 commits
  10. 10 Mar, 2023 1 commit
  11. 05 Mar, 2023 9 commits
    • Linus Torvalds's avatar
      Linux 6.3-rc1 · fe15c26e
      Linus Torvalds authored
      fe15c26e
    • Linus Torvalds's avatar
      cpumask: re-introduce constant-sized cpumask optimizations · 596ff4a0
      Linus Torvalds authored
      Commit aa47a7c2 ("lib/cpumask: deprecate nr_cpumask_bits") resulted
      in the cpumask operations potentially becoming hugely less efficient,
      because suddenly the cpumask was always considered to be variable-sized.
      
      The optimization was then later added back in a limited form by commit
      6f9c07be ("lib/cpumask: add FORCE_NR_CPUS config option"), but that
      FORCE_NR_CPUS option is not useful in a generic kernel and more of a
      special case for embedded situations with fixed hardware.
      
      Instead, just re-introduce the optimization, with some changes.
      
      Instead of depending on CPUMASK_OFFSTACK being false, and then always
      using the full constant cpumask width, this introduces three different
      cpumask "sizes":
      
       - the exact size (nr_cpumask_bits) remains identical to nr_cpu_ids.
      
         This is used for situations where we should use the exact size.
      
       - the "small" size (small_cpumask_bits) is the NR_CPUS constant if it
         fits in a single word and the bitmap operations thus end up able
         to trigger the "small_const_nbits()" optimizations.
      
         This is used for the operations that have optimized single-word
         cases that get inlined, notably the bit find and scanning functions.
      
       - the "large" size (large_cpumask_bits) is the NR_CPUS constant if it
         is an sufficiently small constant that makes simple "copy" and
         "clear" operations more efficient.
      
         This is arbitrarily set at four words or less.
      
      As a an example of this situation, without this fixed size optimization,
      cpumask_clear() will generate code like
      
              movl    nr_cpu_ids(%rip), %edx
              addq    $63, %rdx
              shrq    $3, %rdx
              andl    $-8, %edx
              callq   memset@PLT
      
      on x86-64, because it would calculate the "exact" number of longwords
      that need to be cleared.
      
      In contrast, with this patch, using a MAX_CPU of 64 (which is quite a
      reasonable value to use), the above becomes a single
      
      	movq $0,cpumask
      
      instruction instead, because instead of caring to figure out exactly how
      many CPU's the system has, it just knows that the cpumask will be a
      single word and can just clear it all.
      
      Note that this does end up tightening the rules a bit from the original
      version in another way: operations that set bits in the cpumask are now
      limited to the actual nr_cpu_ids limit, whereas we used to do the
      nr_cpumask_bits thing almost everywhere in the cpumask code.
      
      But if you just clear bits, or scan for bits, we can use the simpler
      compile-time constants.
      
      In the process, remove 'cpumask_complement()' and 'for_each_cpu_not()'
      which were not useful, and which fundamentally have to be limited to
      'nr_cpu_ids'.  Better remove them now than have somebody introduce use
      of them later.
      
      Of course, on x86-64 with MAXSMP there is no sane small compile-time
      constant for the cpumask sizes, and we end up using the actual CPU bits,
      and will generate the above kind of horrors regardless.  Please don't
      use MAXSMP unless you really expect to have machines with thousands of
      cores.
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      596ff4a0
    • Linus Torvalds's avatar
      Merge tag 'v6.3-p2' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 · f915322f
      Linus Torvalds authored
      Pull crypto fix from Herbert Xu:
       "Fix a regression in the caam driver"
      
      * tag 'v6.3-p2' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
        crypto: caam - Fix edesc/iv ordering mixup
      f915322f
    • Linus Torvalds's avatar
      Merge tag 'x86-urgent-2023-03-05' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 7f9ec7d8
      Linus Torvalds authored
      Pull x86 updates from Thomas Gleixner:
       "A small set of updates for x86:
      
         - Return -EIO instead of success when the certificate buffer for SEV
           guests is not large enough
      
         - Allow STIPB to be enabled with legacy IBSR. Legacy IBRS is cleared
           on return to userspace for performance reasons, but the leaves user
           space vulnerable to cross-thread attacks which STIBP prevents.
           Update the documentation accordingly"
      
      * tag 'x86-urgent-2023-03-05' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        virt/sev-guest: Return -EIO if certificate buffer is not large enough
        Documentation/hw-vuln: Document the interaction between IBRS and STIBP
        x86/speculation: Allow enabling STIBP with legacy IBRS
      7f9ec7d8
    • Linus Torvalds's avatar
      Merge tag 'irq-urgent-2023-03-05' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 4e9c542c
      Linus Torvalds authored
      Pull irq updates from Thomas Gleixner:
       "A set of updates for the interrupt susbsystem:
      
         - Prevent possible NULL pointer derefences in
           irq_data_get_affinity_mask() and irq_domain_create_hierarchy()
      
         - Take the per device MSI lock before invoking code which relies on
           it being hold
      
         - Make sure that MSI descriptors are unreferenced before freeing
           them. This was overlooked when the platform MSI code was converted
           to use core infrastructure and results in a fals positive warning
      
         - Remove dead code in the MSI subsystem
      
         - Clarify the documentation for pci_msix_free_irq()
      
         - More kobj_type constification"
      
      * tag 'irq-urgent-2023-03-05' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        genirq/msi, platform-msi: Ensure that MSI descriptors are unreferenced
        genirq/msi: Drop dead domain name assignment
        irqdomain: Add missing NULL pointer check in irq_domain_create_hierarchy()
        genirq/irqdesc: Make kobj_type structures constant
        PCI/MSI: Clarify usage of pci_msix_free_irq()
        genirq/msi: Take the per-device MSI lock before validating the control structure
        genirq/ipi: Fix NULL pointer deref in irq_data_get_affinity_mask()
      4e9c542c
    • Linus Torvalds's avatar
      Merge tag 'pull-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs · 1a90673e
      Linus Torvalds authored
      Pull vfs update from Al Viro:
       "Adding Christian Brauner as VFS co-maintainer"
      
      * tag 'pull-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
        Adding VFS co-maintainer
      1a90673e
    • Linus Torvalds's avatar
      Merge tag 'pull-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs · 1a8d05a7
      Linus Torvalds authored
      Pull VM_FAULT_RETRY fixes from Al Viro:
       "Some of the page fault handlers do not deal with the following case
        correctly:
      
         - handle_mm_fault() has returned VM_FAULT_RETRY
      
         - there is a pending fatal signal
      
         - fault had happened in kernel mode
      
        Correct action in such case is not "return unconditionally" - fatal
        signals are handled only upon return to userland and something like
        copy_to_user() would end up retrying the faulting instruction and
        triggering the same fault again and again.
      
        What we need to do in such case is to make the caller to treat that as
        failed uaccess attempt - handle exception if there is an exception
        handler for faulting instruction or oops if there isn't one.
      
        Over the years some architectures had been fixed and now are handling
        that case properly; some still do not. This series should fix the
        remaining ones.
      
        Status:
      
         - m68k, riscv, hexagon, parisc: tested/acked by maintainers.
      
         - alpha, sparc32, sparc64: tested locally - bug has been reproduced
           on the unpatched kernel and verified to be fixed by this series.
      
         - ia64, microblaze, nios2, openrisc: build, but otherwise completely
           untested"
      
      * tag 'pull-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
        openrisc: fix livelock in uaccess
        nios2: fix livelock in uaccess
        microblaze: fix livelock in uaccess
        ia64: fix livelock in uaccess
        sparc: fix livelock in uaccess
        alpha: fix livelock in uaccess
        parisc: fix livelock in uaccess
        hexagon: fix livelock in uaccess
        riscv: fix livelock in uaccess
        m68k: fix livelock in uaccess
      1a8d05a7
    • Masahiro Yamada's avatar
      Remove Intel compiler support · 95207db8
      Masahiro Yamada authored
      include/linux/compiler-intel.h had no update in the past 3 years.
      
      We often forget about the third C compiler to build the kernel.
      
      For example, commit a0a12c3e ("asm goto: eradicate CC_HAS_ASM_GOTO")
      only mentioned GCC and Clang.
      
      init/Kconfig defines CC_IS_GCC and CC_IS_CLANG but not CC_IS_ICC,
      and nobody has reported any issue.
      
      I guess the Intel Compiler support is broken, and nobody is caring
      about it.
      
      Harald Arnesen pointed out ICC (classic Intel C/C++ compiler) is
      deprecated:
      
          $ icc -v
          icc: remark #10441: The Intel(R) C++ Compiler Classic (ICC) is
          deprecated and will be removed from product release in the second half
          of 2023. The Intel(R) oneAPI DPC++/C++ Compiler (ICX) is the recommended
          compiler moving forward. Please transition to use this compiler. Use
          '-diag-disable=10441' to disable this message.
          icc version 2021.7.0 (gcc version 12.1.0 compatibility)
      
      Arnd Bergmann provided a link to the article, "Intel C/C++ compilers
      complete adoption of LLVM".
      
      lib/zstd/common/compiler.h and lib/zstd/compress/zstd_fast.c were kept
      untouched for better sync with https://github.com/facebook/zstd
      
      Link: https://www.intel.com/content/www/us/en/developer/articles/technical/adoption-of-llvm-complete-icx.htmlSigned-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
      Reviewed-by: default avatarNick Desaulniers <ndesaulniers@google.com>
      Reviewed-by: default avatarNathan Chancellor <nathan@kernel.org>
      Reviewed-by: default avatarMiguel Ojeda <ojeda@kernel.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      95207db8
    • Al Viro's avatar
      Adding VFS co-maintainer · 3304f18b
      Al Viro authored
      Acked-by: default avatarChristian Brauner <brauner@kernel.org>
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      3304f18b
  12. 04 Mar, 2023 2 commits
    • Linus Torvalds's avatar
      Merge tag 'i2c-for-6.3-rc1-part2' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux · b01fe98d
      Linus Torvalds authored
      Pull more i2c updates from Wolfram Sang:
       "Some improvements/fixes for the newly added GXP driver and a Kconfig
        dependency fix"
      
      * tag 'i2c-for-6.3-rc1-part2' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
        i2c: gxp: fix an error code in probe
        i2c: gxp: return proper error on address NACK
        i2c: gxp: remove "empty" switch statement
        i2c: Disable I2C_APPLE when I2C_PASEMI is a builtin
      b01fe98d
    • Linus Torvalds's avatar
      mm: avoid gcc complaint about pointer casting · e77d587a
      Linus Torvalds authored
      The migration code ends up temporarily stashing information of the wrong
      type in unused fields of the newly allocated destination folio.  That
      all works fine, but gcc does complain about the pointer type mis-use:
      
          mm/migrate.c: In function ‘__migrate_folio_extract’:
          mm/migrate.c:1050:20: note: randstruct: casting between randomized structure pointer types (ssa): ‘struct anon_vma’ and ‘struct address_space’
      
           1050 |         *anon_vmap = (void *)dst->mapping;
                |         ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
      
      and gcc is actually right to complain since it really doesn't understand
      that this is a very temporary special case where this is ok.
      
      This could be fixed in different ways by just obfuscating the assignment
      sufficiently that gcc doesn't see what is going on, but the truly
      "proper C" way to do this is by explicitly using a union.
      
      Using unions for type conversions like this is normally hugely ugly and
      syntactically nasty, but this really is one of the few cases where we
      want to make it clear that we're not doing type conversion, we're really
      re-using the value bit-for-bit just using another type.
      
      IOW, this should not become a common pattern, but in this one case using
      that odd union is probably the best way to document to the compiler what
      is conceptually going on here.
      
      [ Side note: there are valid cases where we convert pointers to other
        pointer types, notably the whole "folio vs page" situation, where the
        types actually have fundamental commonalities.
      
        The fact that the gcc note is limited to just randomized structures
        means that we don't see equivalent warnings for those cases, but it
        migth also mean that we miss other cases where we do play these kinds
        of dodgy games, and this kind of explicit conversion might be a good
        idea. ]
      
      I verified that at least for an allmodconfig build on x86-64, this
      generates the exact same code, apart from line numbers and assembler
      comment changes.
      
      Fixes: 64c8902e ("migrate_pages: split unmap_and_move() to _unmap() and _move()")
      Cc: Huang, Ying <ying.huang@intel.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      e77d587a