1. Jul 29, 2022
    • Joerg Roedel's avatar
      Merge branches 'arm/exynos', 'arm/mediatek', 'arm/msm', 'arm/smmu', 'virtio',... · c10100a4
      Joerg Roedel authored
      Merge branches 'arm/exynos', 'arm/mediatek', 'arm/msm', 'arm/smmu', 'virtio', 'x86/vt-d', 'x86/amd' and 'core' into next
      c10100a4
    • Joerg Roedel's avatar
      iommu/amd: Fix compile warning in init code · be280ea7
      Joerg Roedel authored
      A recent commit introduced these compile warnings:
      
        CC      drivers/iommu/amd/init.o
      drivers/iommu/amd/init.c:938:12: error: ‘iommu_init_ga_log’ defined but not used [-Werror=unused-function]
        938 | static int iommu_init_ga_log(struct amd_iommu *iommu)
            |            ^~~~~~~~~~~~~~~~~
      drivers/iommu/amd/init.c:902:12: error: ‘iommu_ga_log_enable’ defined but not used [-Werror=unused-function]
        902 | static int iommu_ga_log_enable(struct amd_iommu *iommu)
            |            ^~~~~~~~~~~~~~~~~~~
      
      The warnings appear because both functions are defined when IRQ
      remapping is not enabled, but only used when IRQ remapping is enabled.
      
      Fix it by only defining the functions when IRQ remapping is enabled.
      
      Fixes: c5e1a1eb
      
       ("iommu/amd: Simplify and Consolidate Virtual APIC (AVIC) Enablement")
      Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
      Link: https://lore.kernel.org/r/20220729100432.22474-1-joro@8bytes.org
      be280ea7
    • Suravee Suthikulpanit's avatar
      iommu/amd: Add support for AVIC when SNP is enabled · 432e5dfc
      Suravee Suthikulpanit authored
      In order to support AVIC on SNP-enabled system, The IOMMU driver needs to
      check EFR2[SNPAVICSup] and enables the support by setting SNPAVICEn bit
      in the IOMMU control register (MMIO offset 18h).
      
      For detail, please see section "SEV-SNP Guest Virtual APIC Support" of the
      AMD I/O Virtualization Technology (IOMMU) Specification.
      (https://www.amd.com/system/files/TechDocs/48882_IOMMU.pdf
      
      )
      
      Signed-off-by: default avatarSuravee Suthikulpanit <suravee.suthikulpanit@amd.com>
      Reviewed-by: default avatarJerry Snitselaar <jsnitsel@redhat.com>
      Link: https://lore.kernel.org/r/20220726134348.6438-3-suravee.suthikulpanit@amd.com
      
      
      Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
      432e5dfc
    • Suravee Suthikulpanit's avatar
      iommu/amd: Simplify and Consolidate Virtual APIC (AVIC) Enablement · c5e1a1eb
      Suravee Suthikulpanit authored
      Currently, enabling AVIC requires individually detect and enable GAM and
      GALOG features on each IOMMU, which is difficult to keep track on
      multi-IOMMU system, where the features needs to be enabled system-wide.
      
      In addition, these features do not need to be enabled in early stage.
      It can be delayed until after amd_iommu_init_pci().
      
      Therefore, consolidate logic for detecting and enabling IOMMU GAM and
      GALOG features into a helper function, enable_iommus_vapic(), which uses
      the check_feature_on_all_iommus() helper function to ensure system-wide
      support of the features before enabling them, and postpone until after
      amd_iommu_init_pci().
      
      The new function also check and clean up feature enablement residue from
      previous boot (e.g. in case of booting into kdump kernel), which triggers
      a WARN_ON (shown below) introduced by the commit a8d4a37d ("iommu/amd:
      Restore GA log/tail pointer on host resume") in iommu_ga_log_enable().
      
      [    7.731955] ------------[ cut here ]------------
      [    7.736575] WARNING: CPU: 0 PID: 1 at drivers/iommu/amd/init.c:829 iommu_ga_log_enable.isra.0+0x16f/0x190
      [    7.746135] Modules linked in:
      [    7.749193] CPU: 0 PID: 1 Comm: swapper/0 Tainted: G        W        --------  ---  5.19.0-0.rc7.53.eln120.x86_64 #1
      [    7.759706] Hardware name: Dell Inc. PowerEdge R7525/04D5GJ, BIOS 2.1.6 03/09/2021
      [    7.767274] RIP: 0010:iommu_ga_log_enable.isra.0+0x16f/0x190
      [    7.772931] Code: 20 20 00 00 8b 00 f6 c4 01 74 da 48 8b 44 24 08 65 48 2b 04 25 28 00 00 00 75 13 48 83 c4 10 5b 5d e9 f5 00 72 00 0f 0b eb e1 <0f> 0b eb dd e8 f8 66 42 00 48 8b 15 f1 85 53 01 e9 29 ff ff ff 48
      [    7.791679] RSP: 0018:ffffc90000107d20 EFLAGS: 00010206
      [    7.796905] RAX: ffffc90000780000 RBX: 0000000000000100 RCX: ffffc90000780000
      [    7.804038] RDX: 0000000000000001 RSI: ffffc90000780000 RDI: ffff8880451f9800
      [    7.811170] RBP: ffff8880451f9800 R08: ffffffffffffffff R09: 0000000000000000
      [    7.818303] R10: 0000000000000000 R11: 0000000000000000 R12: 0008000000000000
      [    7.825435] R13: ffff8880462ea900 R14: 0000000000000021 R15: 0000000000000000
      [    7.832572] FS:  0000000000000000(0000) GS:ffff888054a00000(0000) knlGS:0000000000000000
      [    7.840657] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [    7.846400] CR2: ffff888054dff000 CR3: 0000000053210000 CR4: 0000000000350eb0
      [    7.853533] Call Trace:
      [    7.855979]  <TASK>
      [    7.858085]  amd_iommu_enable_interrupts+0x180/0x270
      [    7.863051]  ? iommu_setup+0x271/0x271
      [    7.866803]  state_next+0x197/0x2c0
      [    7.870295]  ? iommu_setup+0x271/0x271
      [    7.874049]  iommu_go_to_state+0x24/0x2c
      [    7.877976]  amd_iommu_init+0xf/0x29
      [    7.881554]  pci_iommu_init+0xe/0x36
      [    7.885133]  do_one_initcall+0x44/0x200
      [    7.888975]  do_initcalls+0xc8/0xe1
      [    7.892466]  kernel_init_freeable+0x14c/0x199
      [    7.896826]  ? rest_init+0xd0/0xd0
      [    7.900231]  kernel_init+0x16/0x130
      [    7.903723]  ret_from_fork+0x22/0x30
      [    7.907306]  </TASK>
      [    7.909497] ---[ end trace 0000000000000000 ]---
      
      Fixes: commit a8d4a37d
      
       ("iommu/amd: Restore GA log/tail pointer on host resume")
      Reported-by: default avatarJerry Snitselaar <jsnitsel@redhat.com>
      Cc: Joerg Roedel <joro@8bytes.org>
      Cc: Maxim Levitsky <mlevitsk@redhat.com>
      Cc: Will Deacon <will@kernel.org> (maintainer:IOMMU DRIVERS)
      Signed-off-by: default avatarSuravee Suthikulpanit <suravee.suthikulpanit@amd.com>
      Reviewed-by: default avatarJerry Snitselaar <jsnitsel@redhat.com>
      Link: https://lore.kernel.org/r/20220726134348.6438-2-suravee.suthikulpanit@amd.com
      
      
      Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
      c5e1a1eb
    • Ren Zhijie's avatar
      ACPI/IORT: Fix build error implicit-function-declaration · de026976
      Ren Zhijie authored
      If CONFIG_ACPI_IORT=y and CONFIG_IOMMU_API is not set,
      make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-,
      will be failed, like this:
      
      drivers/acpi/arm64/iort.c: In function ‘iort_get_rmr_sids’:
      drivers/acpi/arm64/iort.c:1406:2: error: implicit declaration of function ‘iort_iommu_rmr_get_resv_regions’; did you mean ‘iort_iommu_get_resv_regions’? [-Werror=implicit-function-declaration]
        iort_iommu_rmr_get_resv_regions(iommu_fwnode, NULL, head);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        iort_iommu_get_resv_regions
      cc1: some warnings being treated as errors
      make[3]: *** [drivers/acpi/arm64/iort.o] Error 1
      
      The function iort_iommu_rmr_get_resv_regions()
      is declared under CONFIG_IOMMU_API,
      and the callers of iort_get_rmr_sids() and iort_put_rmr_sids()
      would select IOMMU_API.
      
      To fix this error, move the definitions to #ifdef CONFIG_IOMMU_API.
      
      Fixes: e302eea8
      
       ("ACPI/IORT: Add a helper to retrieve RMR info directly")
      Signed-off-by: default avatarRen Zhijie <renzhijie2@huawei.com>
      Acked-by: default avatarHanjun Guo <guohanjun@huawei.com>
      Link: https://lore.kernel.org/r/20220726033520.47865-1-renzhijie2@huawei.com
      
      
      Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
      de026976
  2. Jul 25, 2022
  3. Jul 24, 2022
  4. Jul 23, 2022
    • Linus Torvalds's avatar
      Merge tag 'spi-fix-v5.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi · 301c8949
      Linus Torvalds authored
      Pull spi fixes from Mark Brown:
       "A few more small driver specific fixes"
      
      * tag 'spi-fix-v5.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi:
        spi: spi-rspi: Fix PIO fallback on RZ platforms
        spi: spi-cadence: Fix SPI NO Slave Select macro definition
        spi: bcm2835: bcm2835_spi_handle_err(): fix NULL pointer deref for non DMA transfers
      301c8949
    • Linus Torvalds's avatar
      Merge tag 'riscv-for-linus-5.19-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux · 70664fc1
      Linus Torvalds authored
      Pull RISC-V fixes from Palmer Dabbelt:
      
       - Two kexec-related build fixes
      
       - A DTS update to make the GPIO nodes match the upcoming dtschema
      
       - A fix that passes -mno-relax directly to the assembler when building
         modules, to work around compilers that fail to do so
      
      * tag 'riscv-for-linus-5.19-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux:
        riscv: add as-options for modules with assembly compontents
        riscv: dts: align gpio-key node names with dtschema
        RISC-V: kexec: Fix build error without CONFIG_KEXEC
        RISCV: kexec: Fix build error without CONFIG_MODULES
      70664fc1
    • Linus Torvalds's avatar
      Merge tag 'acpi-5.19-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · ae21fbac
      Linus Torvalds authored
      Pull ACPI fix from Rafael Wysocki:
       "Fix yet another piece of ACPI CPPC changes fallout on AMD platforms
        (Mario Limonciello)"
      
      * tag 'acpi-5.19-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        ACPI: CPPC: Don't require flexible address space if X86_FEATURE_CPPC is supported
      ae21fbac
    • Linus Torvalds's avatar
      Merge tag 'io_uring-5.19-2022-07-21' of git://git.kernel.dk/linux-block · a5235996
      Linus Torvalds authored
      Pull io_uring fixes from Jens Axboe:
       "Fix for a bad kfree() introduced in this cycle, and a quick fix for
        disabling buffer recycling for IORING_OP_READV.
      
        The latter will get reworked for 5.20, but it gets the job done for
        5.19"
      
      * tag 'io_uring-5.19-2022-07-21' of git://git.kernel.dk/linux-block:
        io_uring: do not recycle buffer in READV
        io_uring: fix free of unallocated buffer list
      a5235996
    • Linus Torvalds's avatar
      Merge tag 'block-5.19-2022-07-21' of git://git.kernel.dk/linux-block · d945404f
      Linus Torvalds authored
      Pull block fix from Jens Axboe:
       "Just a single fix for missing error propagation for an allocation
        failure in raid5"
      
      * tag 'block-5.19-2022-07-21' of git://git.kernel.dk/linux-block:
        md/raid5: missing error code in setup_conf()
      d945404f
    • Linus Torvalds's avatar
      Merge tag 'i2c-for-5.19-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux · 4a1dcf77
      Linus Torvalds authored
      Pull i2c fixes from Wolfram Sang:
       "Two driver bugfixes and a typo fix"
      
      * tag 'i2c-for-5.19-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
        i2c: cadence: Change large transfer count reset logic to be unconditional
        i2c: imx: fix typo in comment
        i2c: mlxcpld: Fix register setting for 400KHz frequency
      4a1dcf77
    • Linus Torvalds's avatar
      Merge tag 'gpio-fixes-for-v5.19-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux · 6f8e4e10
      Linus Torvalds authored
      Pull gpio fixes from Bartosz Golaszewski:
      
       - fix several regmap usage issues in gpio-pca953x
      
       - fix out-of-tree build for GPIO selftests
      
       - fix integer overflow in gpio-xilinx
      
      * tag 'gpio-fixes-for-v5.19-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux:
        gpio: gpio-xilinx: Fix integer overflow
        selftests: gpio: fix include path to kernel headers for out of tree builds
        gpio: pca953x: use the correct register address when regcache sync during init
        gpio: pca953x: use the correct range when do regmap sync
        gpio: pca953x: only use single read/write for No AI mode
      6f8e4e10
    • Linus Torvalds's avatar
      Merge tag 'pinctrl-v5.19-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl · 61471911
      Linus Torvalds authored
      Pull pin control fixes from Linus Walleij:
       "Only driver fixes:
      
         - NULL check for the ralink and sunplus drivers
      
         - Add Jacky Bai as maintainer for the Freescale pin controllers
      
         - Fix pin config ops for the Ocelot LAN966x and SparX5
      
         - Disallow AMD pin control to be a module: the GPIO lines need to be
           active in early boot, so no can do
      
         - Fix the Armada 37xx to use raw spinlocks in the interrupt handler
           path to avoid wait context"
      
      * tag 'pinctrl-v5.19-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
        pinctrl: armada-37xx: use raw spinlocks for regmap to avoid invalid wait context
        pinctrl: armada-37xx: make irq_lock a raw spinlock to avoid invalid wait context
        pinctrl: Don't allow PINCTRL_AMD to be a module
        pinctrl: ocelot: Fix pincfg
        pinctrl: ocelot: Fix pincfg for lan966x
        MAINTAINERS: Update freescale pin controllers maintainer
        pinctrl: sunplus: Add check for kcalloc
        pinctrl: ralink: Check for null return of devm_kcalloc
      61471911
    • Linus Torvalds's avatar
      Merge tag 'sound-5.19-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound · 8f636c6a
      Linus Torvalds authored
      Pull sound fixes from Takashi Iwai:
       "Only undoes the Rockchip BCLK changes to address a regression"
      
      * tag 'sound-5.19-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
        ASoC: rockchip-i2s: Undo BCLK pinctrl changes
        ASoC: rockchip: i2s: Fix NULL pointer dereference when pinctrl is not found
      8f636c6a
    • Linus Torvalds's avatar
      Merge tag 'mmc-v5.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc · 85029503
      Linus Torvalds authored
      Pull MMC fix from Ulf Hansson:
      
       - sdhci-omap: Fix a lockdep warning while probing
      
      * tag 'mmc-v5.19-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc:
        mmc: sdhci-omap: Fix a lockdep warning for PM runtime init
      85029503
    • Linus Torvalds's avatar
      Merge tag 'drm-fixes-2022-07-22' of git://anongit.freedesktop.org/drm/drm · 8e65afba
      Linus Torvalds authored
      Pull drm fixes from Dave Airlie:
       "Fixes for this week.
      
        The main one is the i915 firmware fix for the phoronix reported issue.
        I've written some firmware guidelines as a result, should land in
        -next soon. Otherwise a few amdgpu fixes, a scheduler fix, ttm fix and
        two other minor ones.
      
        scheduler:
         - scheduling while atomic fix
      
        ttm:
         - locking fix
      
        edp:
         - variable typo fix
      
        i915:
         - add back support for v69 firmware on ADL-P
      
        amdgpu:
         - Drop redundant buffer cleanup that can lead to a segfault
         - Add a bo_list mutex to avoid possible list corruption in CS
         - dmub notification fix
      
        imx:
         - fix error path"
      
      * tag 'drm-fixes-2022-07-22' of git://anongit.freedesktop.org/drm/drm:
        drm/amdgpu: Protect the amdgpu_bo_list list with a mutex v2
        drm/imx/dcss: Add missing of_node_put() in fail path
        drm/i915/guc: support v69 in parallel to v70
        drm/i915/guc: Support programming the EU priority in the GuC descriptor
        drm/panel-edp: Fix variable typo when saving hpd absent delay from DT
        drm/amdgpu: Remove one duplicated ef removal
        drm/ttm: fix locking in vmap/vunmap TTM GEM helpers
        drm/scheduler: Don't kill jobs in interrupt context
        drm/amd/display: Fix new dmub notification enabling in DM
      8e65afba
    • Linus Torvalds's avatar
      Merge tag 'rcu-urgent.2022.07.21a' of... · 4ba1329c
      Linus Torvalds authored
      Merge tag 'rcu-urgent.2022.07.21a' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu
      
      Pull RCU fix from Paul McKenney:
       "This contains a pair of commits that fix 282d8998 ("srcu: Prevent
        expedited GPs and blocking readers from consuming CPU"), which was
        itself a fix to an SRCU expedited grace-period problem that could
        prevent kernel live patching (KLP) from completing.
      
        That SRCU fix for KLP introduced large (as in minutes) boot-time
        delays to embedded Linux kernels running on qemu/KVM. These delays
        were due to the emulation of certain MMIO operations controlling
        memory layout, which were emulated with one expedited grace period per
        access. Common configurations required thousands of boot-time MMIO
        accesses, and thus thousands of boot-time expedited SRCU grace
        periods.
      
        In these configurations, the occasional sleeps that allowed KLP to
        proceed caused excessive boot delays. These commits preserve enough
        sleeps to permit KLP to proceed, but few enough that the virtual
        embedded kernels still boot reasonably quickly.
      
        This represents a regression introduced in the v5.19 merge window, and
        the bug is causing significant inconvenience"
      
      * tag 'rcu-urgent.2022.07.21a' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu:
        srcu: Make expedited RCU grace periods block even less frequently
        srcu: Block less aggressively for expedited grace periods
      4ba1329c
    • Linus Torvalds's avatar
      mmu_gather: fix the CONFIG_MMU_GATHER_NO_RANGE case · 7fb5e508
      Linus Torvalds authored
      Sudip reports that alpha doesn't build properly, with errors like
      
        include/asm-generic/tlb.h:401:1: error: redefinition of 'tlb_update_vma_flags'
          401 | tlb_update_vma_flags(struct mmu_gather *tlb, struct vm_area_struct *vma)
              | ^~~~~~~~~~~~~~~~~~~~
        include/asm-generic/tlb.h:372:1: note: previous definition of 'tlb_update_vma_flags' with type 'void(struct mmu_gather *, struct vm_area_struct *)'
          372 | tlb_update_vma_flags(struct mmu_gather *tlb, struct vm_area_struct *vma) { }
      
      the cause being that We have this odd situation where some architectures
      were never converted to the newer TLB flushing interfaces that have a
      range for the flush.  Instead people left them alone, and we have them
      select the MMU_GATHER_NO_RANGE config option to make the tlb header
      files account for this.
      
      Peter Zijlstra cleaned some of these nasty header file games up in
      commits
      
        1e9fdf21 ("mmu_gather: Remove per arch tlb_{start,end}_vma()")
        18ba064e ("mmu_gather: Let there be one tlb_{start,end}_vma() implementation")
      
      but tlb_update_vma_flags() was left alone, and then commit b67fbebd
      
      
      ("mmu_gather: Force tlb-flush VM_PFNMAP vmas") ended up removing only
      _one_ of the two stale duplicate dummy inline functions.
      
      This removes the other stale one.
      
      Somebody braver than me should try to remove MMU_GATHER_NO_RANGE
      entirely, but it requires fixing up the oddball architectures that use
      it: alpha, m68k, microblaze, nios2 and openrisc.
      
      The fixups should be fairly straightforward ("fix the build errors it
      exposes by adding the appropriate range arguments"), but the reason this
      wasn't done in the first place is that so few people end up working on
      those architectures.  But it could be done one architecture at a time,
      hint, hint.
      
      Reported-by: default avatarSudip Mukherjee (Codethink) <sudipm.mukherjee@gmail.com>
      Fixes: b67fbebd ("mmu_gather: Force tlb-flush VM_PFNMAP vmas")
      Link: https://lore.kernel.org/all/YtpXh0QHWwaEWVAY@debian/
      
      
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Will Deacon <will@kernel.org>
      Cc: "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Nick Piggin <npiggin@gmail.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      7fb5e508
  5. Jul 22, 2022